mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-27 12:08:02 -05:00
check if req.user exists
Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
395d9c671b
commit
8ce724175b
1 changed files with 3 additions and 1 deletions
|
@ -58,7 +58,9 @@ if (config.isOpenIDEnable) AuthRouter.use(openid)
|
||||||
// logout
|
// logout
|
||||||
AuthRouter.get('/logout', function (req: Request, res: Response) {
|
AuthRouter.get('/logout', function (req: Request, res: Response) {
|
||||||
if (config.debug && req.isAuthenticated()) {
|
if (config.debug && req.isAuthenticated()) {
|
||||||
logger.debug('user logout: ' + req.user?.id)
|
if (req.user !== undefined) {
|
||||||
|
logger.debug('user logout: ' + req.user.id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
req.logout()
|
req.logout()
|
||||||
res.redirect(config.serverURL + '/')
|
res.redirect(config.serverURL + '/')
|
||||||
|
|
Loading…
Reference in a new issue