Skip to content

Commit be074a4

Browse files
committed
🐛 Fix invalid-session redirect error
1 parent 0338df0 commit be074a4

File tree

1 file changed

+9
-1
lines changed
  • apps/web/src/app/api/auth/invalid-session

1 file changed

+9
-1
lines changed

apps/web/src/app/api/auth/invalid-session/route.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
import type { NextRequest } from "next/server";
22
import { NextResponse } from "next/server";
3+
import auth from "@/lib/auth";
34
import { signOut as legacySignOut } from "@/next-auth";
45

56
export async function GET(req: NextRequest) {
67
try {
7-
await legacySignOut();
8+
await Promise.all([
9+
legacySignOut({
10+
redirect: false,
11+
}),
12+
auth.api.signOut({
13+
headers: req.headers,
14+
}),
15+
]);
816
} catch (error) {
917
console.error("FAILED TO SIGN OUT", error);
1018
}

0 commit comments

Comments
 (0)