login - redirect to homepage if the user is logged
parent
9a1e81f730
commit
db8853d050
|
@ -367,7 +367,8 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
|
||||||
templateUrl: "auth/login.html",
|
templateUrl: "auth/login.html",
|
||||||
title: "LOGIN.PAGE_TITLE",
|
title: "LOGIN.PAGE_TITLE",
|
||||||
description: "LOGIN.PAGE_DESCRIPTION",
|
description: "LOGIN.PAGE_DESCRIPTION",
|
||||||
disableHeader: true
|
disableHeader: true,
|
||||||
|
controller: "LoginPage",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
$routeProvider.when("/register",
|
$routeProvider.when("/register",
|
||||||
|
|
|
@ -27,6 +27,19 @@ debounce = @.taiga.debounce
|
||||||
|
|
||||||
module = angular.module("taigaAuth", ["taigaResources"])
|
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
|
## Authentication Service
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
Loading…
Reference in New Issue