File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { type FC } from "react" ;
2
2
import { Helmet } from "react-helmet-async" ;
3
3
import { useMutation } from "react-query" ;
4
- import { Navigate , useNavigate } from "react-router-dom" ;
4
+ import { Navigate } from "react-router-dom" ;
5
5
import { pageTitle } from "utils/page" ;
6
6
import { createFirstUser } from "api/queries/users" ;
7
7
import { useAuth } from "contexts/auth/useAuth" ;
@@ -18,7 +18,6 @@ export const SetupPage: FC = () => {
18
18
} = useAuth ( ) ;
19
19
const createFirstUserMutation = useMutation ( createFirstUser ( ) ) ;
20
20
const setupIsComplete = ! isConfiguringTheFirstUser ;
21
- const navigate = useNavigate ( ) ;
22
21
23
22
if ( isLoading ) {
24
23
return < FullScreenLoader /> ;
@@ -45,7 +44,10 @@ export const SetupPage: FC = () => {
45
44
onSubmit = { async ( firstUser ) => {
46
45
await createFirstUserMutation . mutateAsync ( firstUser ) ;
47
46
await signIn ( firstUser . email , firstUser . password ) ;
48
- navigate ( "/templates" ) ;
47
+ // The entitlements are fetched from the server and injected in the
48
+ // page metadata. To ensure the data is up-to-date, a full page reload
49
+ // is required.
50
+ window . location . replace ( "/templates" ) ;
49
51
} }
50
52
/>
51
53
</ >
You can’t perform that action at this time.
0 commit comments