Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 9c70b5e

Browse files
author
vikasrohit
committed
AS#100297043256582, Move all login to link of Members to accounts.topcoder.com
-- Added /login back to routes to allow topcoder.com/login url to work
1 parent 8f73edf commit 9c70b5e

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

app/account/account.routes.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import angular from 'angular'
55

66
angular.module('tc.account').config(routes)
77

8-
routes.$inject = ['$stateProvider']
8+
routes.$inject = ['$stateProvider', 'CONSTANTS']
99

10-
function routes($stateProvider) {
10+
function routes($stateProvider, CONSTANTS) {
1111
var states = {
1212
'auth': {
1313
parent: 'root',
@@ -16,6 +16,28 @@ import angular from 'angular'
1616
authRequired: false
1717
}
1818
},
19+
'login': {
20+
url: '/login?next&code&state&status&userJWTToken&utm_source&utm_medium&utm_campaign',
21+
views: {
22+
'header@': {},
23+
'container@': {},
24+
'footer@': {}
25+
},
26+
data: {
27+
authRequired: false
28+
},
29+
onEnter: ['$state', '$window', '$stateParams', 'logger',
30+
function($state, $window, $stateParams, logger) {
31+
console.log('onEnter...')
32+
var next = $state.href('dashboard', {}, {absolute: true})
33+
if ($stateParams.next) {
34+
next = decodeURIComponent($stateParams.next)
35+
}
36+
$window.location = CONSTANTS.ACCOUNTS_APP_URL + '?retUrl=' + encodeURIComponent(next)
37+
}
38+
]
39+
40+
},
1941
logout: {
2042
url: '/logout/',
2143
views: {

0 commit comments

Comments
 (0)