fix: Handle no user request

This commit is contained in:
Bouncey
2018-11-20 10:51:48 +00:00
committed by mrugesh mohapatra
parent b11f4f511d
commit 7d7b2e049f

View File

@ -410,6 +410,9 @@ export default async function bootChallenge(app, done) {
async function redirectToCurrentChallenge(req, res, next) {
const { user } = req;
if (!user) {
return res.redirect(learnURL);
}
const challengeId = user && user.currentChallengeId;
log(req.user.username);
log(challengeId);