diff --git a/changes/issue-5902-sandbox-logout b/changes/issue-5902-sandbox-logout new file mode 100644 index 0000000000..12219277d9 --- /dev/null +++ b/changes/issue-5902-sandbox-logout @@ -0,0 +1 @@ +* Redirect to fleetdm.com when logging out of sandbox \ No newline at end of file diff --git a/frontend/pages/LogoutPage/LogoutPage.tsx b/frontend/pages/LogoutPage/LogoutPage.tsx index 273b21ab12..afb7e77d85 100644 --- a/frontend/pages/LogoutPage/LogoutPage.tsx +++ b/frontend/pages/LogoutPage/LogoutPage.tsx @@ -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);