diff --git a/src/stores/Auth.js b/src/stores/Auth.js index 0b0a211..8b17a0b 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -126,11 +126,16 @@ const useAuthStore = create((set, get) => ({ }, logout: () => { - const { tokenInterval } = get() + const { tokenInterval, currentUser } = get() const { clearStorage } = usingStorage() clearStorage() clearInterval(tokenInterval) - set(initialState) + set(() => ({ + ...initialState, + currentUser: { + username: currentUser.username + } + })) }, startTokenInterval: () => {