Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
2.012
Browse files Browse the repository at this point in the history
  • Loading branch information
dvird committed Apr 29, 2024
1 parent cab04c4 commit 9120373
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions __tests__/EarthoOne/logout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('EarthoOne', () => {
await eartho.logout();

expect(window.location.assign).toHaveBeenCalledWith(
`https://${TEST_DOMAIN}/v2/logout?client_id=${TEST_CLIENT_ID}${TEST_EARTHO_CLIENT_QUERY_STRING}`
`https://${TEST_DOMAIN}/logout?client_id=${TEST_CLIENT_ID}${TEST_EARTHO_CLIENT_QUERY_STRING}`
);
});

Expand All @@ -116,7 +116,7 @@ describe('EarthoOne', () => {
await eartho.logout({ logoutParams: { federated: true } });

expect(window.location.assign).toHaveBeenCalledWith(
`https://${TEST_DOMAIN}/v2/logout?client_id=${TEST_CLIENT_ID}${TEST_EARTHO_CLIENT_QUERY_STRING}&federated`
`https://${TEST_DOMAIN}/logout?client_id=${TEST_CLIENT_ID}${TEST_EARTHO_CLIENT_QUERY_STRING}&federated`
);
});

Expand Down Expand Up @@ -217,7 +217,7 @@ describe('EarthoOne', () => {
expect(window.location.assign).not.toHaveBeenCalled();
expect(onRedirect).toHaveBeenCalledWith(
expect.stringContaining(
'https://eartho_domain/v2/logout?client_id=eartho_client_id'
'https://eartho_domain/logout?client_id=eartho_client_id'
)
);
});
Expand All @@ -230,7 +230,7 @@ describe('EarthoOne', () => {
expect(window.location.assign).not.toHaveBeenCalled();
expect(openUrl).toHaveBeenCalledWith(
expect.stringContaining(
'https://eartho_domain/v2/logout?client_id=eartho_client_id'
'https://eartho_domain/logout?client_id=eartho_client_id'
)
);
});
Expand Down Expand Up @@ -322,7 +322,7 @@ describe('EarthoOne', () => {
await eartho.logout({ clientId: null });

expect(window.location.assign).toHaveBeenCalledWith(
expect.stringContaining('https://eartho_domain/v2/logout')
expect.stringContaining('https://eartho_domain/logout')
);

expect(window.location.assign).toHaveBeenCalledWith(
Expand All @@ -336,7 +336,7 @@ describe('EarthoOne', () => {

expect(window.location.assign).toHaveBeenCalledWith(
expect.stringContaining(
'https://eartho_domain/v2/logout?client_id=my-client-id'
'https://eartho_domain/logout?client_id=my-client-id'
)
);
});
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "@eartho/one-client-js",
"description": "Eartho SDK for authentication, verification and payments",
"license": "Eartho",
"version": "2.0.11",
"version": "2.0.12",
"main": "dist/lib/one-client-js.cjs.js",
"types": "dist/typings/index.d.ts",
"module": "dist/one-client-js.production.esm.js",
Expand Down
2 changes: 1 addition & 1 deletion scripts/oidc-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const config = {
routes: {
authorization: '/connect', // lgtm [js/hardcoded-credentials]
token: '/access/oauth/token',
end_session: '/v2/logout'
end_session: '/logout'
},
scopes: ['openid', 'offline_access'],
clientBasedCORS(ctx, origin, client) {
Expand Down
8 changes: 4 additions & 4 deletions src/EarthoOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ export class EarthoOne {
const { federated, ...logoutOptions } = options.logoutParams || {};
const federatedQuery = federated ? `&federated` : '';
const url = this._url(
`/v2/logout?${createQueryParams({
`/logout?${createQueryParams({
clientId: options.clientId,
...logoutOptions
})}`
Expand Down Expand Up @@ -869,13 +869,13 @@ export class EarthoOne {
cookieDomain: this.options.cookieDomain
});
this.userCache.remove(CACHE_KEY_ID_TOKEN_SUFFIX);

const url = this._buildLogoutUrl(logoutOptions);

if (openUrl) {
await openUrl(url);
//await openUrl(url);
} else if (openUrl !== false) {
window.location.assign(url);
//window.location.assign(url);
}
}

Expand Down

0 comments on commit 9120373

Please sign in to comment.