Skip to content

Commit

Permalink
πŸ› CORS ν™˜κ²½λ³€μˆ˜ Vault κ°’ μˆ˜μ •
Browse files Browse the repository at this point in the history
  • Loading branch information
ldhbenecia committed Nov 23, 2023
1 parent c6792ba commit d499ad6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/backend/src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class AuthController {
maxAge: getSecret('MAX_AGE_REFRESH_TOKEN'),
});

res.redirect(getSecret(`AUTH_REDIRECT_URL`));
res.redirect(getSecret(`DOMAIN`));
} catch (error) {
throw new UnauthorizedException('Failed to handle Google login callback');
}
Expand Down Expand Up @@ -121,7 +121,7 @@ export class AuthController {
res.setHeader('Authorization', 'Bearer ' + newAccessToken);
res.cookie('access_token', newAccessToken, {
httpOnly: false,
maxAge: Number(getSecret('MAX_AGE_ACCESS_TOKEN')),
maxAge: getSecret('MAX_AGE_ACCESS_TOKEN'),
});

res.json({ newAccessToken });
Expand Down
2 changes: 1 addition & 1 deletion app/backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.use(cookieParser());
app.enableCors({
origin: process.env.DOMAIN,
origin: getSecret(`DOMAIN`),
credentials: true,
});
setupSwagger(app);
Expand Down

0 comments on commit d499ad6

Please sign in to comment.