23 lines
550 B
TypeScript
23 lines
550 B
TypeScript
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;
|