mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Logout of sandbox redirects to marketing site (#6726)
This commit is contained in:
parent
da1868d6ae
commit
2de047b888
2 changed files with 6 additions and 1 deletions
1
changes/issue-5902-sandbox-logout
Normal file
1
changes/issue-5902-sandbox-logout
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Redirect to fleetdm.com when logging out of sandbox
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import { useContext, useEffect } from "react";
|
||||
import { InjectedRouter } from "react-router";
|
||||
|
||||
import { AppContext } from "context/app";
|
||||
import { NotificationContext } from "context/notification";
|
||||
import sessionsAPI from "services/entities/sessions";
|
||||
import { clearToken } from "utilities/local";
|
||||
|
|
@ -10,6 +11,7 @@ interface ILogoutPageProps {
|
|||
}
|
||||
|
||||
const LogoutPage = ({ router }: ILogoutPageProps) => {
|
||||
const { isSandboxMode } = useContext(AppContext);
|
||||
const { renderFlash } = useContext(NotificationContext);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -18,7 +20,9 @@ const LogoutPage = ({ router }: ILogoutPageProps) => {
|
|||
await sessionsAPI.destroy();
|
||||
clearToken();
|
||||
setTimeout(() => {
|
||||
window.location.href = "/";
|
||||
window.location.href = isSandboxMode
|
||||
? "https://www.fleetdm.com"
|
||||
: "/";
|
||||
}, 500);
|
||||
} catch (response) {
|
||||
console.error(response);
|
||||
|
|
|
|||
Loading…
Reference in a new issue