next url support in login view if the user is logged in

stable
Alejandro Alonso 2016-03-30 10:37:13 +02:00
parent 08340bee37
commit d7340c57a4
1 changed files with 10 additions and 3 deletions

View File

@ -31,12 +31,19 @@ class LoginPage
@.$inject = [ @.$inject = [
'tgCurrentUserService', 'tgCurrentUserService',
'$location', '$location',
'$tgNavUrls' '$tgNavUrls',
'$routeParams'
] ]
constructor: (currentUserService, $location, $navUrls) -> constructor: (currentUserService, $location, $navUrls, $routeParams) ->
if currentUserService.isAuthenticated() if currentUserService.isAuthenticated()
$location.path($navUrls.resolve("home")) url = $navUrls.resolve("home")
if $routeParams['next']
url = $routeParams['next']
$location.search('next', null)
$location.path(url)
module.controller('LoginPage', LoginPage) module.controller('LoginPage', LoginPage)