mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-27 15:12:56 +03:00
fix: cookie name (#4293)
This commit is contained in:
parent
2db0cec443
commit
46fd732ee6
@ -148,13 +148,15 @@ export class NextAuthController {
|
||||
}
|
||||
|
||||
let nextAuthTokenCookie: (CookieOption & { value: string }) | undefined;
|
||||
const cookiePrefix = this.config.node.prod ? '__Secure-' : '';
|
||||
const sessionCookieName = `${cookiePrefix}next-auth.session-token`;
|
||||
// next-auth credentials login only support JWT strategy
|
||||
// https://next-auth.js.org/configuration/providers/credentials
|
||||
// let's store the session token in the database
|
||||
if (
|
||||
credentialsSignIn &&
|
||||
(nextAuthTokenCookie = cookies?.find(
|
||||
({ name }) => name === 'next-auth.session-token'
|
||||
({ name }) => name === sessionCookieName
|
||||
))
|
||||
) {
|
||||
const cookieExpires = new Date();
|
||||
|
Loading…
Reference in New Issue
Block a user