mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #314 from sharelatex/ja-login-improvements
Ja login improvements
This commit is contained in:
commit
31ee019ecb
2 changed files with 8 additions and 4 deletions
|
@ -99,13 +99,17 @@ module.exports = AuthorizationMiddlewear =
|
||||||
callback null, user_id
|
callback null, user_id
|
||||||
|
|
||||||
redirectToRestricted: (req, res, next) ->
|
redirectToRestricted: (req, res, next) ->
|
||||||
res.redirect "/restricted"
|
res.redirect "/restricted?from=#{encodeURIComponent(req.url)}"
|
||||||
|
|
||||||
restricted : (req, res, next)->
|
restricted : (req, res, next)->
|
||||||
if req.session.user?
|
if req.session.user?
|
||||||
res.render 'user/restricted',
|
res.render 'user/restricted',
|
||||||
title:'restricted'
|
title:'restricted'
|
||||||
else
|
else
|
||||||
logger.log "user not logged in and trying to access #{req.url}, being redirected to login"
|
from = req.query.from
|
||||||
res.redirect '/register'
|
logger.log {from: from}, "redirecting to login"
|
||||||
|
redirect_to = "/login"
|
||||||
|
if from?
|
||||||
|
redirect_to += "?redir=#{encodeURIComponent(from)}"
|
||||||
|
res.redirect redirect_to
|
||||||
|
|
|
@ -155,6 +155,6 @@
|
||||||
| #{translate("or_unlock_features_bonus")}
|
| #{translate("or_unlock_features_bonus")}
|
||||||
a(href="/user/bonus") #{translate("sharing_sl")} .
|
a(href="/user/bonus") #{translate("sharing_sl")} .
|
||||||
script.
|
script.
|
||||||
window.userHasNoSubscription = #{settings.enableSubscriptions && !hasSubscription}
|
window.userHasNoSubscription = #{!!(settings.enableSubscriptions && !hasSubscription)}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue