Add route to handle /teams similar to v1

This commit is contained in:
Alasdair Smith 2018-09-18 17:14:37 +01:00
parent b16cffe587
commit bdcc25805e

View file

@ -329,6 +329,14 @@ module.exports = class Router
AuthenticationController.httpAuth,
CompileController.getFileFromClsiWithoutUser
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")
#Admin Stuff
webRouter.get '/admin', AuthorizationMiddlewear.ensureUserIsSiteAdmin, AdminController.index
webRouter.get '/admin/user', AuthorizationMiddlewear.ensureUserIsSiteAdmin, (req, res)-> res.redirect("/admin/register") #this gets removed by admin-panel addon