mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-27 17:13:18 +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;
|
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
|
// next-auth credentials login only support JWT strategy
|
||||||
// https://next-auth.js.org/configuration/providers/credentials
|
// https://next-auth.js.org/configuration/providers/credentials
|
||||||
// let's store the session token in the database
|
// let's store the session token in the database
|
||||||
if (
|
if (
|
||||||
credentialsSignIn &&
|
credentialsSignIn &&
|
||||||
(nextAuthTokenCookie = cookies?.find(
|
(nextAuthTokenCookie = cookies?.find(
|
||||||
({ name }) => name === 'next-auth.session-token'
|
({ name }) => name === sessionCookieName
|
||||||
))
|
))
|
||||||
) {
|
) {
|
||||||
const cookieExpires = new Date();
|
const cookieExpires = new Date();
|
||||||
|
Loading…
Reference in New Issue
Block a user