mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #974 from sharelatex/as-fix-docs-redirect
Fix /docs redirect
This commit is contained in:
commit
1182e1a9e3
1 changed files with 7 additions and 1 deletions
|
@ -330,13 +330,19 @@ module.exports = class Router
|
|||
AuthenticationController.httpAuth,
|
||||
CompileController.getFileFromClsiWithoutUser
|
||||
|
||||
# We want to redirect POST and GET to different locations, but this is
|
||||
# unsupported by RedirectManager. Therefore we redirect GETs with
|
||||
# RedirectManager and POSTs with this custom route
|
||||
publicApiRouter.post '/docs', (req, res, next) ->
|
||||
res.redirect(307, "#{Settings.overleaf.host}/docs")
|
||||
|
||||
webRouter.get '/teams', (req, res, next) ->
|
||||
# Match v1 behaviour - if the user is signed in, show their teams list
|
||||
# Otherwise show some information about teams
|
||||
if AuthenticationController.isUserLoggedIn(req)
|
||||
res.redirect('/user/subscription')
|
||||
else
|
||||
res.redirect("#{settings.v1Api.host}/teams")
|
||||
res.redirect("#{settings.overleaf.host}/teams")
|
||||
|
||||
webRouter.get '/chrome', (req, res, next) ->
|
||||
# Match v1 behaviour - this is used for a Chrome web app
|
||||
|
|
Loading…
Reference in a new issue