Skip to content

Commit

Permalink
im tired this is enough
Browse files Browse the repository at this point in the history
  • Loading branch information
harshkhandeparkar committed Dec 16, 2023
1 parent f564825 commit 8e1dd6a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/util/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {

const updateAuth = (auth: ILocalStorageAuthObj) => {
setUserAuth(auth);

console.log(auth)
setFormLink(
userAuth.userData.type === "student"
? ROUTER_PATHS.STUDENT_FORM
Expand All @@ -167,11 +169,13 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {

const onLogin = (auth: ILocalStorageAuthObj) => {
setIsAuthenticated(true);
setUserType(auth.userData.type);
updateAuth(auth);
};

const onRegister = (userData: IUserAuthData) => {
setIsRegistered(true);
setUserType(userData.type);

const newUserAuth = {
...userAuth,
Expand Down

0 comments on commit 8e1dd6a

Please sign in to comment.