diff --git a/src/app/core/auth/auth.service.spec.ts b/src/app/core/auth/auth.service.spec.ts index 4c4efc2f62b..cc446e5dc2f 100644 --- a/src/app/core/auth/auth.service.spec.ts +++ b/src/app/core/auth/auth.service.spec.ts @@ -343,6 +343,8 @@ describe('AuthService test', () => { }); it('should return a token object', () => { + mockStore.overrideSelector(getAuthenticationToken, token); + mockStore.refreshState(); const result = authService.getToken(); expect(result).toEqual(token); }); diff --git a/src/app/core/orcid/orcid-auth.service.spec.ts b/src/app/core/orcid/orcid-auth.service.spec.ts index 9909d779e31..414a799bc49 100644 --- a/src/app/core/orcid/orcid-auth.service.spec.ts +++ b/src/app/core/orcid/orcid-auth.service.spec.ts @@ -298,7 +298,7 @@ describe('OrcidAuthService', () => { it('should build the url properly', () => { const result = service.getOrcidAuthorizeUrl(mockItemUnlinkedToOrcid); - const redirectUri: string = new URLCombiner(nativeWindowService.nativeWindow.origin, encodeURIComponent(routerStub.url.split('?')[0])).toString(); + const redirectUri: string = new URLCombiner(nativeWindowService.nativeWindow.origin, routerStub.url.split('?')[0]).toString(); const url = 'orcid.authorize-url?client_id=orcid.application-client-id&redirect_uri=' + redirectUri + '&response_type=code&scope=/authenticate /read-limited'; const expected = cold('(a|)', { diff --git a/src/app/core/orcid/orcid-auth.service.ts b/src/app/core/orcid/orcid-auth.service.ts index 6175a979801..f63975ba71e 100644 --- a/src/app/core/orcid/orcid-auth.service.ts +++ b/src/app/core/orcid/orcid-auth.service.ts @@ -127,7 +127,7 @@ export class OrcidAuthService { this.configurationService.findByPropertyName('orcid.scope').pipe(getFirstSucceededRemoteDataPayload())], ).pipe( map(([authorizeUrl, clientId, scopes]) => { - const redirectUri = new URLCombiner(this._window.nativeWindow.origin, encodeURIComponent(this.router.url.split('?')[0])); + const redirectUri = new URLCombiner(this._window.nativeWindow.origin, this.router.url.split('?')[0]); return authorizeUrl.values[0] + '?client_id=' + clientId.values[0] + '&redirect_uri=' + redirectUri + '&response_type=code&scope=' + scopes.values.join(' '); }));