Skip to content

Commit

Permalink
Feat: #123 로그아웃 시 유저 store 정보 초기화 기능 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoonyesol committed Sep 14, 2024
1 parent d684f6d commit 8c447e7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/stores/useStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ const createUserSlice: StateCreator<Store, [], [], UserStore> = (set) => ({
}),

clearUserInfo: () => {
set({
userInfo: {
provider: 'LOCAL',
userId: 0,
username: null,
email: '',
nickname: '',
bio: null,
links: [],
profileImageName: null,
},
});
localStorage.removeItem('user-storage');
},
});
Expand Down

0 comments on commit 8c447e7

Please sign in to comment.