This commit is contained in:
parent
bc010c94ff
commit
c53f2bfbc9
@ -118,18 +118,18 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getCookieOptions(isRefreshToken = false) {
|
getCookieOptions(isRefreshToken = false) {
|
||||||
const isProduction =
|
// const isProduction =
|
||||||
this.configService.get<string>("NODE_ENV") === "production";
|
// this.configService.get<string>("NODE_ENV") === "production";
|
||||||
const cookieSecure =
|
// const cookieSecure =
|
||||||
this.configService.get<string>("COOKIE_SECURE") === "true";
|
// this.configService.get<string>("COOKIE_SECURE") === "true";
|
||||||
const domain = this.configService.get<string>("COOKIE_DOMAIN");
|
// const domain = this.configService.get<string>("COOKIE_DOMAIN");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
secure: isProduction || cookieSecure,
|
// secure: isProduction || cookieSecure,
|
||||||
sameSite: "none" as const,
|
sameSite: "none" as const,
|
||||||
path: isRefreshToken ? "/auth/refresh" : "/",
|
path: isRefreshToken ? "/auth/refresh" : "/",
|
||||||
domain: domain,
|
// domain: domain,
|
||||||
maxAge: isRefreshToken ? 7 * 24 * 60 * 60 * 1000 : 15 * 60 * 1000,
|
maxAge: isRefreshToken ? 7 * 24 * 60 * 60 * 1000 : 15 * 60 * 1000,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user