Commit 78329c24 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

add customized error when user data is not found

6 merge requests!143updating yml config,!129Hide mobile menu in account pages,!128Hide mobile menu in account pages,!126prepare production deployment,!121Mlab 566 fix,!117add customized error when user data is not found
Showing with 8 additions and 4 deletions
+8 -4
......@@ -106,10 +106,14 @@ export = function (app:any, config:any, passport:any, lang:string) {
res.redirect('/login')
} else {
let loggedInUser = await getLoggedInUserData(req.user.email)
res.render(lang+'/account/home', {
user: loggedInUser
});
if (!loggedInUser) {
console.error("user data is not found")
res.status(500).render(lang+'/500', { error: "Your data is not found. Please try again." })
} else {
res.render(lang+'/account/home', {
user: loggedInUser
});
}
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment