Просмотр исходного кода

Merge pull request #946 from sharelatex/as-chrome-redirect

Add /chrome redirect to match v1 behaviour
James Allen 8 лет назад
Родитель
Сommit
525aa9fd3a
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      services/web/app/coffee/router.coffee

+ 9 - 0
services/web/app/coffee/router.coffee

@@ -330,6 +330,7 @@ module.exports = class Router
 			AuthenticationController.httpAuth,
 			CompileController.getFileFromClsiWithoutUser
 
+<<<<<<< HEAD
 		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
@@ -337,6 +338,14 @@ module.exports = class Router
 				res.redirect('/user/subscription')
 			else
 				res.redirect("#{settings.v1Api.host}/teams")
+=======
+		webRouter.get '/chrome', (req, res, next) ->
+			# Match v1 behaviour - this is used for a Chrome web app
+			if AuthenticationController.isUserLoggedIn(req)
+				res.redirect('/project')
+			else
+				res.redirect('/register')
+>>>>>>> Add /chrome redirect to match v1 behaviour
 
 		#Admin Stuff
 		webRouter.get  '/admin', AuthorizationMiddlewear.ensureUserIsSiteAdmin, AdminController.index