diff --git a/src/auth/index.tsx b/src/auth/index.tsx index 4a5f92c2f..e57a0159b 100644 --- a/src/auth/index.tsx +++ b/src/auth/index.tsx @@ -12,6 +12,7 @@ import LoginView from "./views/Login"; import NewPassword from "./views/NewPassword"; import ResetPassword from "./views/ResetPassword"; import ResetPasswordSuccess from "./views/ResetPasswordSuccess"; +import LoginLoading from "./components/LoginLoading"; interface UserContext { login: (username: string, password: string) => void; @@ -30,12 +31,20 @@ export const UserContext = React.createContext({ tokenVerifyLoading: false }); -const AuthRouter: React.FC = () => ( +interface AuthRouterProps { + hasToken: boolean; +} + +const AuthRouter: React.FC = ({ hasToken }) => ( - + {!hasToken ? ( + + ) : ( + + )} diff --git a/src/index.tsx b/src/index.tsx index 915593649..9339671bf 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -275,7 +275,7 @@ const Routes: React.FC = () => { ) : hasToken && tokenVerifyLoading ? ( ) : ( - + ) }