feat: 完善环境标识配置
This commit was merged in pull request #1.
This commit is contained in:
+3
-1
@@ -2,6 +2,8 @@ import "server-only";
|
||||
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
import { getAppEnv } from "@/lib/environment";
|
||||
|
||||
const DEFAULT_COOKIE_NAME = "role_user_session";
|
||||
|
||||
export function getSessionCookieName() {
|
||||
@@ -17,7 +19,7 @@ export async function setSessionToken(token: string) {
|
||||
|
||||
cookieStore.set(getSessionCookieName(), token, {
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === "production",
|
||||
secure: getAppEnv() === "production",
|
||||
sameSite: "lax",
|
||||
path: "/",
|
||||
maxAge: 60 * 60 * 8
|
||||
|
||||
Reference in New Issue
Block a user