mirror of
https://github.com/outline/outline.git
synced 2026-01-06 02:59:54 -06:00
18 lines
439 B
TypeScript
18 lines
439 B
TypeScript
import { Redirect } from "react-router-dom";
|
|
import env from "~/env";
|
|
import useStores from "~/hooks/useStores";
|
|
import { logoutPath } from "~/utils/routeHelpers";
|
|
|
|
const Logout = () => {
|
|
const { auth } = useStores();
|
|
|
|
void auth.logout({ userInitiated: true });
|
|
|
|
if (env.OIDC_LOGOUT_URI) {
|
|
return null; // user will be redirected to logout URI after logout
|
|
}
|
|
return <Redirect to={logoutPath()} />;
|
|
};
|
|
|
|
export default Logout;
|