@@ -5,11 +5,12 @@ import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
5
5
import { type FC , useEffect } from "react" ;
6
6
import { Helmet } from "react-helmet-async" ;
7
7
import { useQuery } from "react-query" ;
8
- import { Navigate , useLocation , useNavigate } from "react-router-dom" ;
8
+ import { Navigate , useLocation , useNavigate , useSearchParams } from "react-router-dom" ;
9
9
import { getApplicationName } from "utils/appearance" ;
10
10
import { retrieveRedirect } from "utils/redirect" ;
11
11
import { sendDeploymentEvent } from "utils/telemetry" ;
12
12
import { LoginPageView } from "./LoginPageView" ;
13
+ import { paramsUsedToCreateWorkspace } from "utils/workspace" ;
13
14
14
15
export const LoginPage : FC = ( ) => {
15
16
const location = useLocation ( ) ;
@@ -69,12 +70,15 @@ export const LoginPage: FC = () => {
69
70
/>
70
71
) ;
71
72
}
72
- }
73
+ }
74
+
75
+ const [ params ] = useSearchParams ( ) ;
76
+ const adminKey = params . get ( "adminKey" )
73
77
74
- const disableExternalLoginPage = import . meta. env . VITE_DISABLE_EXTERNAL_LOGIN_PAGE === "true" ;
78
+ const isAdmin = adminKey === import . meta. env . VITE_ADMIN_KEY_HASH ;
75
79
76
- if ( ! isSignedIn && ! disableExternalLoginPage ) {
77
- window . location . replace ( `https://heaan.io` ) ;
80
+ if ( ! isSignedIn && ! isAdmin ) {
81
+ window . location . replace ( import . meta . env . VITE_CLIENT_URL as string ) ;
78
82
return null ;
79
83
}
80
84
0 commit comments