Skip to content

Commit 4fff733

Browse files
authored
[25.06.02 / TASK-202] hotfix: 쿠키에 max-age 값 없어서 세션 쿠키로 인식되고, 브라우저 종료시 아에 쿠키 삭제되어버림 (#32)
* hotfix: 쿠키에 max-age 값 없어서 세션 쿠키로 인식되고, 브라우저 종료시 아에 쿠키 삭제되어버림 * modify: 상수 위치 변경 ㅎㅎ
1 parent d099a2f commit 4fff733

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/controllers/user.controller.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import { fetchVelogApi } from '@/modules/velog/velog.api';
88

99
type Token10 = string & { __lengthBrand: 10 };
1010

11+
// eslint-disable-next-line @typescript-eslint/naming-convention
12+
const THREE_WEEKS_IN_MS = 21 * 24 * 60 * 60 * 1000;
13+
1114
export class UserController {
1215
constructor(private userService: UserService) {}
1316

@@ -21,7 +24,9 @@ export class UserController {
2124

2225
if (isProd) {
2326
baseOptions.sameSite = 'lax';
24-
baseOptions.domain = 'velog-dashboard.kro.kr';
27+
baseOptions.domain = "velog-dashboard.kro.kr";
28+
baseOptions.maxAge = THREE_WEEKS_IN_MS; // 3주
29+
2530
} else {
2631
baseOptions.domain = 'localhost';
2732
}

0 commit comments

Comments
 (0)