mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Fleet Sandbox: Login for sandbox redirects to sandbox's login url (#7220)
This commit is contained in:
parent
78af071fce
commit
9f8ccd8113
2 changed files with 10 additions and 0 deletions
1
changes/issue-7211-redirect-to-sandbox-login
Normal file
1
changes/issue-7211-redirect-to-sandbox-login
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Sandbox redirects to sandbox login
|
||||
|
|
@ -28,6 +28,10 @@ export const AuthenticatedRoutes = ({
|
|||
return router.push(LOGIN);
|
||||
};
|
||||
|
||||
const redirectToSandboxLogin = () => {
|
||||
return router.push("https://www.fleetdm.com/try-fleet/login");
|
||||
};
|
||||
|
||||
const redirectToPasswordReset = () => {
|
||||
const { RESET_PASSWORD } = paths;
|
||||
|
||||
|
|
@ -43,7 +47,12 @@ export const AuthenticatedRoutes = ({
|
|||
useDeepEffect(() => {
|
||||
// this works with App.tsx. if authToken does
|
||||
// exist, user state is checked and fetched if null
|
||||
|
||||
if (!authToken()) {
|
||||
if (window.location.pathname.includes("sandbox")) {
|
||||
return redirectToSandboxLogin();
|
||||
}
|
||||
|
||||
return redirectToLogin();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue