From bdcc25805e4b0294f991d89ecad648971f568f55 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Tue, 18 Sep 2018 17:14:37 +0100 Subject: [PATCH] Add route to handle /teams similar to v1 --- services/web/app/coffee/router.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/web/app/coffee/router.coffee b/services/web/app/coffee/router.coffee index b196c56870..e8fc6fa259 100644 --- a/services/web/app/coffee/router.coffee +++ b/services/web/app/coffee/router.coffee @@ -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