diff --git a/packages/core/client/src/user/CurrentUserProvider.tsx b/packages/core/client/src/user/CurrentUserProvider.tsx index 8a6b261146..1740870a3c 100644 --- a/packages/core/client/src/user/CurrentUserProvider.tsx +++ b/packages/core/client/src/user/CurrentUserProvider.tsx @@ -11,7 +11,7 @@ import React, { createContext, useContext, useMemo } from 'react'; import { Navigate } from 'react-router-dom'; import { useACLRoleContext } from '../acl'; import { ReturnTypeOfUseRequest, useRequest } from '../api-client'; -import { useLocationNoUpdate } from '../application'; +import { useAppSpin, useLocationNoUpdate } from '../application'; import { useCompile } from '../schema-component'; export const CurrentUserContext = createContext(null); @@ -39,10 +39,15 @@ export const useCurrentRoles = () => { }; export const CurrentUserProvider = (props) => { + const { render } = useAppSpin(); const result = useRequest({ url: 'auth:check', }); + if (result.loading) { + return render(); + } + return {props.children}; };