Integrated the Verify state into the UserContext.jsx
This commit is contained in:
parent
d9fb53bccc
commit
c91c30a15a
@ -2,6 +2,7 @@ import {createContext, useEffect, useState} from "react";
|
||||
import Login from "@/states/Login";
|
||||
import Loading from "@/states/Loading";
|
||||
import {sessionRequest} from "@/common/utils/RequestUtil.js";
|
||||
import Verify from "@/states/Verify";
|
||||
|
||||
export const UserContext = createContext({});
|
||||
|
||||
@ -37,6 +38,8 @@ export const UserProvider = (props) => {
|
||||
|
||||
if (loading) return (<Loading />);
|
||||
|
||||
if (location.pathname.startsWith("/verify")) return <Verify />;
|
||||
|
||||
return (
|
||||
<UserContext.Provider value={{user, updateUser, updateSessionToken}}>
|
||||
{!loading && !user.loggedIn && <Login />}
|
||||
|
Loading…
x
Reference in New Issue
Block a user