Skip to content

Commit 9ada64a

Browse files
committed
fix: Proper cookie invalidation
1 parent dbfc3cf commit 9ada64a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/server-actions.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,13 @@ export const signIn = async (): Promise<NextResponse> => {
2929
};
3030

3131
export const signOut = async (): Promise<NextResponse> => {
32-
const config = getGlobalConfig();
3332
const cookieStore = await cookies();
3433
const token = cookieStore.get("AUTH_SESSION")?.value;
3534
if (!token) {
3635
return NextResponse.json({ message: "Not signed in" }, { status: 401 });
3736
}
3837

39-
try {
40-
jwt.verify(token, config.jwtSecret);
41-
} catch {
42-
return NextResponse.json({ message: "Invalid session" }, { status: 401 });
43-
}
44-
4538
cookieStore.delete("AUTH_SESSION");
39+
40+
return NextResponse.json({ message: "Signed out successfully" }, { status: 200 });
4641
};

0 commit comments

Comments
 (0)