Add ability to logout from OIDC (#6539)

* Add OIDC_LOGOUT_URI functionality

* Add logout redirect to work on logout route

* Fix lint

* Fix lint

* Fix lint

* Fix lint

* Return null if logout endpoint used

* Update import
This commit is contained in:
Shuttleu
2024-02-16 16:35:38 +00:00
committed by GitHub
parent 2c9b01391f
commit bc84714670
7 changed files with 29 additions and 1 deletions

View File

@@ -1,10 +1,15 @@
import * as React from "react";
import { Redirect } from "react-router-dom";
import env from "~/env";
import useStores from "~/hooks/useStores";
const Logout = () => {
const { auth } = useStores();
void auth.logout();
if (env.OIDC_LOGOUT_URI) {
window.location.replace(env.OIDC_LOGOUT_URI);
return null;
}
return <Redirect to="/" />;
};