Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 007cbcc

Browse files
author
vikasrohit
committedApr 22, 2016
AS#100297043256582, Move all login to link of Members to accounts.topcoder.com
-- Fixed lint errors
1 parent 8be43e2 commit 007cbcc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
 

‎app/account/account.routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import angular from 'angular'
3737
title: 'Login'
3838
},
3939
template: '',
40-
controller: 'LoginController',
40+
controller: 'LoginController'
4141
},
4242
'register': {
4343
parent: 'auth',

‎app/account/login/login.controller.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { getCurrentUser, loadUser } from '../../services/userv3.service.js'
66

77
angular.module('tc.account').controller('LoginController', LoginController)
88

9-
LoginController.$inject = ['logger', '$state', '$stateParams', '$location', '$scope', 'TcAuthService', 'UserService', 'Helpers', 'CONSTANTS']
9+
LoginController.$inject = ['logger', '$state', '$stateParams', '$window', '$rootScope', 'TcAuthService', 'UserService', 'Helpers', 'CONSTANTS']
1010

11-
function LoginController(logger, $state, $stateParams, $location, $scope, TcAuthService, UserService, Helpers, CONSTANTS) {
11+
function LoginController(logger, $state, $stateParams, $window, $rootScope, TcAuthService, UserService, Helpers, CONSTANTS) {
1212
var vm = this
1313
vm.$stateParams = $stateParams
1414

@@ -25,8 +25,8 @@ import { getCurrentUser, loadUser } from '../../services/userv3.service.js'
2525
logger.debug('State requires authentication, and user is not logged in, redirecting')
2626
// setup redirect for post login
2727
event.preventDefault()
28-
var next = $state.href(toState.name, toParams, {absolute: true})
29-
var retUrl = next
28+
var next = $stateParams.next ? $stateParams.next : 'dashboard'
29+
var retUrl = $state.href(next, {}, {absolute: true})
3030
$window.location = CONSTANTS.ACCOUNTS_APP_URL + '?retUrl=' + encodeURIComponent(retUrl)
3131
})
3232
}

0 commit comments

Comments
 (0)
This repository has been archived.