mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02:00
remove unnecessary error returns and ip fetching
This commit is contained in:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user