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 3b0da40

Browse files
author
vikasrohit
committedAug 3, 2016
AS#162402573361607, Cannot reach member page if handle contains a period
-- Fixed unit tests
1 parent 9b37262 commit 3b0da40

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed
 

‎app/services/jwtInterceptor.service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import { isTokenExpired, getFreshToken } from 'tc-accounts'
8181
// logger.debug('idToken: ' + idToken)
8282
if (!TcAuthService.isAuthenticated() || idToken == null) {
8383
logger.debug(String.supplant('Skipping authToken for "{url}, UnAuthenticated user"', config))
84-
return
84+
return null
8585
}
8686

8787
// Note only v3tokens expire

‎app/services/jwtInterceptor.service.spec.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,28 +78,24 @@ describe('JWT Interceptor Service', function() {
7878
expect(TcAuthService.isAuthenticated).to.be.have.been.calledOnce
7979
})
8080

81-
it('should redirect to login page for other endpoints', function() {
81+
it('should return null as token for other endpoints', function() {
8282
var config = {
8383
method: 'get',
8484
url: apiUrl + '/v3/members/test'
8585
}
86-
service.getToken(config)
87-
expect($window.location).not.null
88-
expect($window.location).to.have.string(CONSTANTS.ACCOUNTS_APP_URL)
86+
var token = service.getToken(config)
8987
expect(TcAuthService.isAuthenticated).to.be.have.been.calledOnce
90-
expect(fakeState.href).to.be.calledWith('dashboard')
88+
expect(token).to.be.null
9189
})
9290

93-
it('should redirect to login page for other endpoints', function() {
91+
it('should return null as token for other endpoints', function() {
9492
var config = {
9593
method: 'get',
9694
url: apiUrl + '/v3.0.0-BETA/members/test'
9795
}
98-
service.getToken(config)
99-
expect($window.location).not.null
100-
expect($window.location).to.have.string(CONSTANTS.ACCOUNTS_APP_URL)
96+
var token = service.getToken(config)
10197
expect(TcAuthService.isAuthenticated).to.be.have.been.calledOnce
102-
expect(fakeState.href).to.be.calledWith('dashboard')
98+
expect(token).to.be.null
10399
})
104100

105101
afterEach(function() {

0 commit comments

Comments
 (0)
This repository has been archived.