fixing auth, switching corporate, table member
This commit is contained in:
@@ -75,11 +75,12 @@ type AuthProviderProps = {
|
||||
|
||||
function AuthProvider({ children }: AuthProviderProps) {
|
||||
const [state, dispatch] = useReducer(JWTReducer, initialState);
|
||||
const accessToken = getSession();
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
try {
|
||||
const accessToken = getSession();
|
||||
// const accessToken = getSession();
|
||||
|
||||
if (accessToken) {
|
||||
setSession(accessToken);
|
||||
@@ -113,7 +114,7 @@ function AuthProvider({ children }: AuthProviderProps) {
|
||||
});
|
||||
}
|
||||
})();
|
||||
}, []);
|
||||
}, [accessToken]);
|
||||
|
||||
const login = async (phoneOrEmail: string) =>
|
||||
axios
|
||||
|
||||
Reference in New Issue
Block a user