From d499ad6d89ec840c145267537695649f98d9dd2b Mon Sep 17 00:00:00 2001 From: DongHyeok Lim Date: Thu, 23 Nov 2023 22:52:13 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20CORS=20=ED=99=98=EA=B2=BD?= =?UTF-8?q?=EB=B3=80=EC=88=98=20Vault=20=EA=B0=92=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/backend/src/auth/auth.controller.ts | 4 ++-- app/backend/src/main.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/backend/src/auth/auth.controller.ts b/app/backend/src/auth/auth.controller.ts index a7514ff08..9f074f45d 100644 --- a/app/backend/src/auth/auth.controller.ts +++ b/app/backend/src/auth/auth.controller.ts @@ -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'); } @@ -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 }); diff --git a/app/backend/src/main.ts b/app/backend/src/main.ts index 3e9e7c8d7..8bcec3320 100644 --- a/app/backend/src/main.ts +++ b/app/backend/src/main.ts @@ -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);