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

Commit f711f75

Browse files
author
vikasrohit
committed
AS#153276200846788, Redirect loop for some users on production
-- Fixed incorrect redirection. It should redirect to dashboard after accounts app validation instead of MAIN_URL.
1 parent a23c393 commit f711f75

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/services/jwtInterceptor.service.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import { isTokenExpired, getFreshToken } from 'tc-accounts'
2727
.catch(function(err) {
2828
// Server will not or cannot refresh token
2929
logger.debug('Unable to refresh V3 token, redirecting to login')
30-
var retUrl = CONSTANTS.MAIN_URL + '/?next=' + config.url
31-
$window.location = CONSTANTS.ACCOUNTS_APP_URL + '?retUrl=' + encodeURIComponent(retUrl)
30+
var next = $state.href('dashboard', {}, {absolute: true})
31+
$window.location = CONSTANTS.ACCOUNTS_APP_URL + '?retUrl=' + encodeURIComponent(next)
3232

3333
return null
3434
})
@@ -83,8 +83,8 @@ import { isTokenExpired, getFreshToken } from 'tc-accounts'
8383
// logger.debug('idToken: ' + idToken)
8484
if (!TcAuthService.isAuthenticated() || idToken == null) {
8585
// logger.debug('redirecting to accounts app')
86-
var retUrl = CONSTANTS.MAIN_URL + '/?next=' + config.url
87-
$window.location = CONSTANTS.ACCOUNTS_APP_URL + '?retUrl=' + encodeURIComponent(retUrl)
86+
var next = $state.href('dashboard', {}, {absolute: true})
87+
$window.location = CONSTANTS.ACCOUNTS_APP_URL + '?retUrl=' + encodeURIComponent(next)
8888
return
8989
}
9090

0 commit comments

Comments
 (0)