Skip to content

Commit

Permalink
fix: remember me expires in 1 year (#661)
Browse files Browse the repository at this point in the history
Closes #546
  • Loading branch information
andrew-codes authored Dec 8, 2024
2 parents b4263fb + af2b0b3 commit 10f7267
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export const signIn: NonNullable<MutationResolvers['signIn']> = 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,
})
Expand Down

0 comments on commit 10f7267

Please sign in to comment.