feat: add the tiktok integration
This commit is contained in:
@@ -7,7 +7,13 @@ export async function middleware(req: NextRequest) {
|
||||
const { pathname } = req.nextUrl;
|
||||
const isProtected = protectedPaths.some((p) => pathname.startsWith(p));
|
||||
|
||||
const token = await getToken({ req, secret: process.env.AUTH_SECRET });
|
||||
const token = await getToken({
|
||||
req,
|
||||
secret: process.env.AUTH_SECRET,
|
||||
cookieName: process.env.NODE_ENV === "production"
|
||||
? "__Secure-authjs.session-token"
|
||||
: "authjs.session-token"
|
||||
});
|
||||
|
||||
if (isProtected && !token) {
|
||||
const loginUrl = new URL("/", req.url);
|
||||
|
||||
Reference in New Issue
Block a user