Fix unhandled rejection

This commit is contained in:
Calvin Montgomery 2017-08-14 20:31:45 -07:00
parent c6c3bafca2
commit 99076412b6
1 changed files with 10 additions and 6 deletions

View File

@ -19,12 +19,16 @@ export default function initialize(app, session) {
let rank;
if (!global_rank) {
rank = await backfillRankIntoAuthCookie(
session,
new Date(parseInt(expiration, 10)),
req,
res
);
try {
rank = await backfillRankIntoAuthCookie(
session,
new Date(parseInt(expiration, 10)),
req,
res
);
} catch (error) {
return next();
}
} else {
rank = parseInt(global_rank, 10);
}