Logout of sandbox redirects to marketing site (#6726)

This commit is contained in:
RachelElysia 2022-07-19 11:43:57 -04:00 committed by GitHub
parent da1868d6ae
commit 2de047b888
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1 @@
* Redirect to fleetdm.com when logging out of sandbox

View file

@ -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);