Skip to content

Commit

Permalink
Merge branch 'release-3.x.x' into TASK-7225
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes authored Dec 16, 2024
2 parents 4e12223 + 78c05be commit 2ec94ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/core/clients/opencga/opencga-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ export class OpenCGAClient {
Cookies.expire(this._config.cookies.prefix + "_userId");
// eslint-disable-next-line no-undef
Cookies.expire(this._config.cookies.prefix + "_sid");
// Remove sso token only if sso mode is enabled
if (this._config?.sso?.active && this._config?.sso?.cookie) {
// eslint-disable-next-line no-undef
Cookies.expire(this._config.sso.cookie);
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/sites/iva/iva-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ class IvaApp extends LitElement {
.catch(e => {
console.error(e);
this.notificationManager.error("Error creating session", e.message);
// clear cookies and reset opencgaSession
this.opencgaClient.logout();
this._createOpencgaSessionFromConfig();
})
.finally(() => {
this.isCreatingSession = false;
Expand Down Expand Up @@ -689,9 +692,6 @@ class IvaApp extends LitElement {
// 3. Check if sso is active and logged user is not local
// In this case, we will redirect to 'meta/sso/logout' endpoint
if (this.opencgaClient?._config?.sso?.active && !isLocalUser) {
// eslint-disable-next-line no-undef
Cookies.expire(this.opencgaClient._config.sso.cookie);

const config = this.opencgaClient._config;
const ivaUrl = window.location;
window.location = `${config.host}/webservices/rest/${config.version}/meta/sso/logout?url=${ivaUrl}`;
Expand Down

0 comments on commit 2ec94ff

Please sign in to comment.