From 34a52c33914cd8b996519dbb7c008c2c7c76f23b Mon Sep 17 00:00:00 2001 From: choidabom <48302257+choidabom@users.noreply.github.com> Date: Fri, 13 Sep 2024 12:26:39 +0900 Subject: [PATCH] Add missing refresh token settings in `docker-compose-full.yml` (#344) --- backend/docker/docker-compose-full.yml | 5 ++++- backend/src/check/check.module.ts | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/docker/docker-compose-full.yml b/backend/docker/docker-compose-full.yml index 621534cd..fa0a23df 100644 --- a/backend/docker/docker-compose-full.yml +++ b/backend/docker/docker-compose-full.yml @@ -11,7 +11,10 @@ services: GITHUB_CLIENT_ID: "your_github_client_id_here" GITHUB_CLIENT_SECRET: "your_github_client_secret_here" GITHUB_CALLBACK_URL: "http://localhost:3000/auth/login/github" - JWT_AUTH_SECRET: "you_should_change_this_secret_key_in_production" + JWT_ACCESS_TOKEN_SECRET: "you_should_change_this_access_token_secret_key_in_production" + JWT_ACCESS_TOKEN_EXPIRATION_TIME: 86400 + JWT_REFRESH_TOKEN_SECRET: "you_should_change_this_refresh_token_secret_key_in_production" + JWT_REFRESH_TOKEN_EXPIRATION_TIME: 604800 FRONTEND_BASE_URL: "http://localhost:5173" YORKIE_API_ADDR: "http://yorkie:8080" YORKIE_PROJECT_NAME: "default" diff --git a/backend/src/check/check.module.ts b/backend/src/check/check.module.ts index 653438c6..5016ab7c 100644 --- a/backend/src/check/check.module.ts +++ b/backend/src/check/check.module.ts @@ -11,8 +11,10 @@ import { JwtModule } from "@nestjs/jwt"; global: true, useFactory: async (configService: ConfigService) => { return { - signOptions: { expiresIn: "24h" }, - secret: configService.get("JWT_AUTH_SECRET"), + secret: configService.get("JWT_ACCESS_TOKEN_SECRET"), + signOptions: { + expiresIn: `${configService.get("JWT_ACCESS_TOKEN_EXPIRATION_TIME")}s`, + }, }; }, inject: [ConfigService],