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

Commit df0c889

Browse files
committed
fix nonce param and timeout unit test
1 parent 68fa540 commit df0c889

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/authentication/oauth2Auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
116116
}
117117

118118
if (this.config.oauth2.implicitFlow) {
119-
this.checkFragment({ nonceKey: 'nonce' });
119+
this.checkFragment('nonce');
120120
}
121121
}
122122

@@ -130,7 +130,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
130130
return this.config.provider === 'ECM' || this.config.provider === 'ALL';
131131
}
132132

133-
checkFragment(externalHash?: any, nonceKey?: string): any {// jshint ignore:line
133+
checkFragment(nonceKey?: string, externalHash?: any): any {// jshint ignore:line
134134
this.hashFragmentParams = this.getHashFragmentParams(externalHash);
135135

136136
if (this.hashFragmentParams && this.hashFragmentParams.error === undefined) {
@@ -485,7 +485,7 @@ export class Oauth2Auth extends AlfrescoApiClient {
485485
let silentRefreshTokenIframe: any = document.getElementById('silent_refresh_token_iframe');
486486
let hash = silentRefreshTokenIframe.contentWindow.location.hash;
487487
try {
488-
this.checkFragment(hash, 'refresh_nonce');
488+
this.checkFragment('refresh_nonce', hash);
489489
} catch (e) {
490490
this.logOut();
491491
}

test/oauth2Auth.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ describe('Oauth2 test', () => {
350350
});
351351

352352
it('should extend content session after oauth token refresh', function (done) {
353+
this.timeout(3000);
354+
353355
oauth2Mock.get200Response();
354356
authResponseMock.get200ValidTicket();
355357

0 commit comments

Comments
 (0)