You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Add support for redirecting to external pages after logout (#7905)
* Add support for redirecting to external pages after logout This is primarily useful for deployments where the account is managed and needs to be logged out in other places too, like an SSO system. See docs for more information. * Add e2e test and fix Windows instructions * Fix performance gathering stats * use logger
This commit is contained in:
@@ -58,6 +58,7 @@ import LazyLoadingDisabledDialog from "./components/views/dialogs/LazyLoadingDis
|
||||
import SessionRestoreErrorDialog from "./components/views/dialogs/SessionRestoreErrorDialog";
|
||||
import StorageEvictedDialog from "./components/views/dialogs/StorageEvictedDialog";
|
||||
import { setSentryUser } from "./sentry";
|
||||
import SdkConfig from "./SdkConfig";
|
||||
|
||||
const HOMESERVER_URL_KEY = "mx_hs_url";
|
||||
const ID_SERVER_URL_KEY = "mx_is_url";
|
||||
@@ -845,6 +846,13 @@ export async function onLoggedOut(): Promise<void> {
|
||||
stopMatrixClient();
|
||||
await clearStorage({ deleteEverything: true });
|
||||
LifecycleCustomisations.onLoggedOutAndStorageCleared?.();
|
||||
|
||||
// Do this last so we can make sure all storage has been cleared and all
|
||||
// customisations got the memo.
|
||||
if (SdkConfig.get().logout_redirect_url) {
|
||||
logger.log("Redirecting to external provider to finish logout");
|
||||
window.location.href = SdkConfig.get().logout_redirect_url;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user