Skip to content

Commit

Permalink
fix: 쿠키 유효기간 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Xvezda committed May 4, 2024
1 parent 0a353a5 commit 9d4d844
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/api/src/services/auth/v1/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,14 @@ const verifyToken = async <T extends Record<string, any>, C extends Context = Co
return payload;
};

const signToken = async <T extends Record<string, any>, C extends Context = Context>(context: C, payload: T, expires: string | number | Date) => {
const signToken = async <
T extends Record<string, any>,
C extends Context = Context
>(
context: C,
payload: T,
expires: string | number | Date
) => {
const privateKey = await jose.importPKCS8(u8ToString(jose.base64url.decode(context.env.JWT_SECRET_KEY)), 'ES256');
const jwt = await new jose.SignJWT(payload)
.setProtectedHeader({ alg: 'ES256' })
Expand Down Expand Up @@ -437,7 +444,7 @@ app.get('/callback', async (c) => {
httpOnly: true,
sameSite: 'None',
secure: true,
expires,
expires: monthLater,
...c.env.DEV ? {} : {
domain: '.cheda.kr',
},
Expand Down

0 comments on commit 9d4d844

Please sign in to comment.