issue #33
All checks were successful
Test CI / build (push) Successful in 19s

- 로그인 요청 후 응답을 AuthData 로 저장 로직 구현
- Access/Refresh 토큰 구현 중
This commit is contained in:
geonhee-min
2025-12-01 16:22:40 +09:00
parent 877bbc582e
commit 45dc4cbaaa
11 changed files with 97 additions and 34 deletions

View File

@@ -8,6 +8,15 @@ interface AuthStoreProps {
export const useAuthStore = create<AuthStoreProps>((set) => ({
authData: undefined,
login: (data: AuthData) => set({ authData: data }),
logout: () => set({ authData: undefined })
login: (data: AuthData) => {
set({ authData: data });
Object.entries(data)
.forEach((entry) => {
localStorage.setItem(entry[0], entry[1]);
})
},
logout: () => {
set({ authData: undefined });
localStorage.clear();
}
}));