Fontend supertokens, authprovider.

This commit is contained in:
2022-09-08 11:31:44 +02:00
parent 8bed3632a2
commit cd28031637
7 changed files with 119 additions and 7 deletions

View 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;