Skip to content

Commit

Permalink
fix(server): fix crash when session token returns no data in auth mid…
Browse files Browse the repository at this point in the history
…dleware (#1814)
  • Loading branch information
dyc3 authored Nov 7, 2024
1 parent e327ab5 commit 2905d20
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ export async function authTokenMiddleware(
return;
}

req.ottsession = await tokens.getSessionInfo(req.token);
try {
req.ottsession = await tokens.getSessionInfo(req.token);
} catch (err) {
log.warn(`Error getting session info in auth middleware: ${err}`);
}
if (!req.ottsession) {
res.status(401).json({
success: false,
Expand Down

0 comments on commit 2905d20

Please sign in to comment.