Skip to content

Commit

Permalink
fix: signoutHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
ynwd committed Dec 1, 2024
1 parent fa2740c commit 44e9d8c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions modules/auth/mod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,12 @@ export const callbackHandler = async (req: HttpRequest, ctx: Context) => {

export const signoutHandler = async (req: HttpRequest, ctx: Context) => {
const sessionId = await getSessionId(req);
if (!sessionId) throw new Error("session ID is undefined");
const store = ctx.stores.get("core");
if (store) {
store.delete(sessionId);
await store.commit();
if (sessionId) {
const store = ctx.stores.get("core");
if (store) {
store.delete(sessionId);
await store.commit();
}
return await signOut(req);
}
};
Expand Down

0 comments on commit 44e9d8c

Please sign in to comment.