Skip to content

Commit

Permalink
more delete cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer committed Feb 23, 2024
1 parent 3f82f1c commit 3a946b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions website/src/middleware/authMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export const authMiddleware = defineMiddleware(async (context, next) => {
context.locals.session = {
isLoggedIn: false,
};
logger.debug(`Token found but could not get user info, not enforcing login`);
deleteCookie(context);
return next();
}
Expand Down Expand Up @@ -131,6 +132,7 @@ export const authMiddleware = defineMiddleware(async (context, next) => {
const userInfo = await getUserInfo(token);
if (userInfo.isErr()) {
logger.debug(`Failed to get user info, redirecting to auth`);
deleteCookie(context);
return redirectToAuth(context);
}

Expand Down

0 comments on commit 3a946b7

Please sign in to comment.