mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-23 05:52:57 +00:00
Remove stray next
params.
This commit is contained in:
parent
4cc4a4e264
commit
167f01857a
1 changed files with 6 additions and 6 deletions
|
@ -127,7 +127,7 @@ module.exports = AuthenticationController =
|
|||
requireLogin: () ->
|
||||
doRequest = (req, res, next = (error) ->) ->
|
||||
if !AuthenticationController.isUserLoggedIn(req)
|
||||
AuthenticationController._redirectToLoginOrRegisterPage(req, res, next)
|
||||
AuthenticationController._redirectToLoginOrRegisterPage(req, res)
|
||||
else
|
||||
req.user = AuthenticationController.getSessionUser(req)
|
||||
next()
|
||||
|
@ -156,22 +156,22 @@ module.exports = AuthenticationController =
|
|||
logger.err user:user, pass:pass, "invalid login details"
|
||||
return isValid
|
||||
|
||||
_redirectToLoginOrRegisterPage: (req, res, next)->
|
||||
_redirectToLoginOrRegisterPage: (req, res)->
|
||||
if (req.query.zipUrl? or
|
||||
req.query.project_name? or
|
||||
req.path == '/user/subscription/new')
|
||||
return AuthenticationController._redirectToRegisterPage(req, res, next)
|
||||
return AuthenticationController._redirectToRegisterPage(req, res)
|
||||
else
|
||||
AuthenticationController._redirectToLoginPage(req, res, next)
|
||||
AuthenticationController._redirectToLoginPage(req, res)
|
||||
|
||||
_redirectToLoginPage: (req, res, next) ->
|
||||
_redirectToLoginPage: (req, res) ->
|
||||
logger.log url: req.url, "user not logged in so redirecting to login page"
|
||||
AuthenticationController._setRedirectInSession(req)
|
||||
url = "/login?#{querystring.stringify(req.query)}"
|
||||
res.redirect url
|
||||
Metrics.inc "security.login-redirect"
|
||||
|
||||
_redirectToRegisterPage: (req, res, next) ->
|
||||
_redirectToRegisterPage: (req, res) ->
|
||||
logger.log url: req.url, "user not logged in so redirecting to register page"
|
||||
AuthenticationController._setRedirectInSession(req)
|
||||
url = "/register?#{querystring.stringify(req.query)}"
|
||||
|
|
Loading…
Reference in a new issue