diff --git a/src/apis/core.ts b/src/apis/core.ts index 6aa9e10..e3a6025 100644 --- a/src/apis/core.ts +++ b/src/apis/core.ts @@ -72,7 +72,10 @@ const refreshAccessToken = async (token: string) => { return accessToken; } catch (error) { - console.error(error); + removeLocalStorage("accessToken"); + removeLocalStorage("refreshToken"); + + window.location.href = "/"; throw new Error("Failed to refresh token"); } }; diff --git a/src/assets/svg/big-activity.svg b/src/assets/svg/big-activity.svg index caf0846..a4733d3 100644 --- a/src/assets/svg/big-activity.svg +++ b/src/assets/svg/big-activity.svg @@ -1,7 +1,7 @@ - - - - - - + + + + + + diff --git a/src/store/auth.ts b/src/store/auth.ts index 796dabf..e84a187 100644 --- a/src/store/auth.ts +++ b/src/store/auth.ts @@ -23,8 +23,6 @@ import { SignupResponse, } from "@/types/auth"; -import { $getLoggedInUserDetails } from "./user"; - export const $checkEmail = atomWithMutation(() => ({ mutationFn: (email: string): Promise => checkEmail(email), })); @@ -37,11 +35,8 @@ export const $signup = atomWithMutation(() => ({ mutationFn: (body: SignupRequest): Promise => postSignup(body), })); -export const $login = atomWithMutation((get) => ({ +export const $login = atomWithMutation(() => ({ mutationFn: (body: LoginRequest): Promise => postLogin(body), - onSuccess: async () => { - (await get($getLoggedInUserDetails)).refetch(); - }, })); export const $postKakaoToken = atomWithMutation(() => ({