From af2b0b342d5b444e1c4fa0f051cc15b262a788ee Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Sun, 8 Dec 2024 10:10:50 -0500 Subject: [PATCH] remember me for 1 year --- .../graphql/modules/auth/resolvers/Mutation/signIn.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/playnite-web/src/server/graphql/modules/auth/resolvers/Mutation/signIn.ts b/apps/playnite-web/src/server/graphql/modules/auth/resolvers/Mutation/signIn.ts index da5bb040..cb5e34db 100755 --- a/apps/playnite-web/src/server/graphql/modules/auth/resolvers/Mutation/signIn.ts +++ b/apps/playnite-web/src/server/graphql/modules/auth/resolvers/Mutation/signIn.ts @@ -15,14 +15,14 @@ export const signIn: NonNullable = async ( new UsernamePasswordCredential(_arg.input.username, _arg.input.password), ) + const expires = new Date() + expires.setFullYear(expires.getFullYear() + 1) _ctx.request.cookieStore?.set({ name: 'authorization', sameSite: 'strict', secure: true, domain: _ctx.domain, - expires: _arg.input.rememberMe - ? null - : new Date(Date.now() + 1000 * 60 * 60 * 24 * 14), + expires: _arg.input.rememberMe ? null : expires, value: `Bearer ${claim.credential}`, httpOnly: true, })