next url support in login view if the user is logged in
parent
08340bee37
commit
d7340c57a4
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue