Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app/core/auth/auth.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/orcid/orcid-auth.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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|)', {
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/orcid/orcid-auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(' ');
}));
Expand Down
Loading