fix: Handle no user request
This commit is contained in:
committed by
mrugesh mohapatra
parent
b11f4f511d
commit
7d7b2e049f
@ -410,6 +410,9 @@ export default async function bootChallenge(app, done) {
|
|||||||
|
|
||||||
async function redirectToCurrentChallenge(req, res, next) {
|
async function redirectToCurrentChallenge(req, res, next) {
|
||||||
const { user } = req;
|
const { user } = req;
|
||||||
|
if (!user) {
|
||||||
|
return res.redirect(learnURL);
|
||||||
|
}
|
||||||
const challengeId = user && user.currentChallengeId;
|
const challengeId = user && user.currentChallengeId;
|
||||||
log(req.user.username);
|
log(req.user.username);
|
||||||
log(challengeId);
|
log(challengeId);
|
||||||
|
Reference in New Issue
Block a user