feat: add login page and auth logic

This commit is contained in:
2025-06-10 17:50:28 +05:00
parent 599bf22bda
commit d55a99aafd
6 changed files with 120 additions and 8 deletions

View File

@@ -11,6 +11,7 @@ type UserStoreState = {
type UserStoreActions = {
setUser: (user: User) => void;
removeUser: () => void;
};
type UserStore = UserStoreState & UserStoreActions;
@@ -22,6 +23,7 @@ export const useUserStore = create<UserStore>()(
user: userInfo != null ? JSON.parse(userInfo) : ({} as User),
loading: false,
setUser: (user: User) => set({ user }),
removeUser: () => set({ user: {} as User }),
}),
{ name: 'userInfo' }
)