Fontend supertokens, authprovider.
This commit is contained in:
22
frontend/src/context/AuthContext.tsx
Normal file
22
frontend/src/context/AuthContext.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { useLocation, useNavigate } from "@solidjs/router";
|
||||
import { createContext } from "solid-js";
|
||||
import { createStore } from "solid-js/store";
|
||||
|
||||
const AuthStateContext = createContext();
|
||||
const AuthDispatchContext = createContext();
|
||||
|
||||
const initialState = {
|
||||
isAuthenticated: false,
|
||||
isLoading: true,
|
||||
currentUser: null,
|
||||
currentAccount: null,
|
||||
};
|
||||
|
||||
const AuthProvider = (props: any) => {
|
||||
const [store, setStore] = createStore(initialState);
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
|
||||
};
|
||||
|
||||
export default AuthProvider;
|
||||
Reference in New Issue
Block a user