We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbfc3cf commit 9ada64aCopy full SHA for 9ada64a
src/server-actions.ts
@@ -29,18 +29,13 @@ export const signIn = async (): Promise<NextResponse> => {
29
};
30
31
export const signOut = async (): Promise<NextResponse> => {
32
- const config = getGlobalConfig();
33
const cookieStore = await cookies();
34
const token = cookieStore.get("AUTH_SESSION")?.value;
35
if (!token) {
36
return NextResponse.json({ message: "Not signed in" }, { status: 401 });
37
}
38
39
- try {
40
- jwt.verify(token, config.jwtSecret);
41
- } catch {
42
- return NextResponse.json({ message: "Invalid session" }, { status: 401 });
43
- }
44
-
45
cookieStore.delete("AUTH_SESSION");
+
+ return NextResponse.json({ message: "Signed out successfully" }, { status: 200 });
46
0 commit comments