mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Don't get user id from possibly deleted session
This commit is contained in:
parent
426b699865
commit
750b524771
1 changed files with 6 additions and 1 deletions
|
@ -12,7 +12,12 @@ module.exports = UserController =
|
|||
req.session.destroy()
|
||||
logger.log user: req.user, "reciving request for getting logged in users personal info"
|
||||
return next(new Error("User is not logged in")) if !req.user?
|
||||
UserGetter.getUser req.session.user._id, { first_name: true, last_name: true, role:true, institution:true }, (error, user) ->
|
||||
UserGetter.getUser req.user._id, {
|
||||
first_name: true, last_name: true,
|
||||
role:true, institution:true,
|
||||
email: true, signUpDate: true
|
||||
}, (error, user) ->
|
||||
return next(error) if error?
|
||||
UserController.sendFormattedPersonalInfo(user, res, next)
|
||||
|
||||
getPersonalInfo: (req, res, next = (error) ->) ->
|
||||
|
|
Loading…
Reference in a new issue