mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-13 09:44:02 +00:00
remove unnecessary error returns and ip fetching
This commit is contained in:
parent
8ef90a0dcb
commit
1e04a09ec6
2 changed files with 3 additions and 10 deletions
|
@ -123,9 +123,7 @@ module.exports = AuthenticationController =
|
|||
|
||||
ipMatchCheck: (req, user) ->
|
||||
if req.ip != user.lastLoginIp
|
||||
NotificationsBuilder.ipMatcherAffiliation(user._id, req.ip).create((err) ->
|
||||
return err
|
||||
)
|
||||
NotificationsBuilder.ipMatcherAffiliation(user._id, req.ip).create()
|
||||
UserUpdater.updateUser user._id.toString(), {
|
||||
$set: { "lastLoginIp": req.ip }
|
||||
}
|
||||
|
|
|
@ -213,14 +213,9 @@ module.exports = ProjectController =
|
|||
|
||||
# in v2 add notifications for matching university IPs
|
||||
if Settings.overleaf?
|
||||
ip = req.headers['x-forwarded-for'] ||
|
||||
req.connection.remoteAddress ||
|
||||
req.socket.remoteAddress
|
||||
UserGetter.getUser user_id, { 'lastLoginIp': 1 }, (error, user) ->
|
||||
if ip != user.lastLoginIp
|
||||
NotificationsBuilder.ipMatcherAffiliation(user._id, ip).create((err) ->
|
||||
return err
|
||||
)
|
||||
if req.ip != user.lastLoginIp
|
||||
NotificationsBuilder.ipMatcherAffiliation(user._id, req.ip).create()
|
||||
|
||||
ProjectController._injectProjectOwners projects, (error, projects) ->
|
||||
return next(error) if error?
|
||||
|
|
Loading…
Reference in a new issue