auth/email: Redirect on (un)successful registration

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-04-13 19:49:12 +02:00
parent 3ea64b2308
commit dd63f789f7
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB

View file

@ -59,11 +59,11 @@ export const EmailMiddleware: AuthMiddleware = {
if (created) {
logger.debug('user registered: ' + user.id)
req.flash('info', "You've successfully registered, please signin.")
return
return res.redirect(config.serverURL + '/')
} else {
logger.debug('user found: ' + user.id)
req.flash('error', 'This email has been used, please try another one.')
return
return res.redirect(config.serverURL + '/')
}
}
req.flash('error', 'Failed to register your account, please try again.')