login - redirect to homepage if the user is logged

stable
Juanfran 2016-02-23 13:05:49 +01:00
parent 9a1e81f730
commit db8853d050
2 changed files with 15 additions and 1 deletions

View File

@ -367,7 +367,8 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
templateUrl: "auth/login.html",
title: "LOGIN.PAGE_TITLE",
description: "LOGIN.PAGE_DESCRIPTION",
disableHeader: true
disableHeader: true,
controller: "LoginPage",
}
)
$routeProvider.when("/register",

View File

@ -27,6 +27,19 @@ debounce = @.taiga.debounce
module = angular.module("taigaAuth", ["taigaResources"])
class LoginPage
@.$inject = [
'tgCurrentUserService',
'$location',
'$tgNavUrls'
]
constructor: (currentUserService, $location, $navUrls) ->
if currentUserService.isAuthenticated()
$location.path($navUrls.resolve("home"))
module.controller('LoginPage', LoginPage)
#############################################################################
## Authentication Service
#############################################################################