mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
debug domain
This commit is contained in:
parent
b0a53d9f6c
commit
39c96dce59
30
lib/auth.ts
30
lib/auth.ts
@ -131,21 +131,21 @@ export const authOptions: NextAuthOptions = {
|
||||
},
|
||||
adapter: PrismaAdapter(prisma),
|
||||
session: { strategy: "jwt", maxAge: 3 * 24 * 60 * 60 },
|
||||
cookies: {
|
||||
sessionToken: {
|
||||
name: `${SECURE_COOKIES ? "__Secure-" : ""}next-auth.session-token`,
|
||||
options: {
|
||||
httpOnly: true,
|
||||
sameSite: "lax",
|
||||
path: "/",
|
||||
// When working on localhost, the cookie domain must be omitted entirely (https://stackoverflow.com/a/1188145)
|
||||
// domain: VERCEL_DEPLOYMENT
|
||||
// ? `.${process.env.NEXT_PUBLIC_ROOT_DOMAIN}`
|
||||
// : undefined,
|
||||
secure: SECURE_COOKIES,
|
||||
},
|
||||
},
|
||||
},
|
||||
// cookies: {
|
||||
// sessionToken: {
|
||||
// name: `${SECURE_COOKIES ? "__Secure-" : ""}next-auth.session-token`,
|
||||
// options: {
|
||||
// httpOnly: true,
|
||||
// sameSite: "lax",
|
||||
// path: "/",
|
||||
// // When working on localhost, the cookie domain must be omitted entirely (https://stackoverflow.com/a/1188145)
|
||||
// // domain: VERCEL_DEPLOYMENT
|
||||
// // ? `.${process.env.NEXT_PUBLIC_ROOT_DOMAIN}`
|
||||
// // : undefined,
|
||||
// secure: SECURE_COOKIES,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
callbacks: {
|
||||
jwt: async ({ token, user }) => {
|
||||
// const current_time = Math.floor(Date.now() / 1000);
|
||||
|
@ -11,6 +11,7 @@ export default async function middleware(req: NextRequest) {
|
||||
const path = `${url.pathname}${
|
||||
searchParams.length > 0 ? `?${searchParams}` : ""
|
||||
}`;
|
||||
console.log('----', url)
|
||||
// 直接将/app/下面路由重定向到顶层
|
||||
if (path.startsWith('/app')) {
|
||||
return NextResponse.redirect(new URL(path.replace('/app', ''), req.url), 301);
|
||||
|
Loading…
Reference in New Issue
Block a user