From ced1436a60aa8518e81821c3a4f6af2c44aba78b Mon Sep 17 00:00:00 2001 From: J'aimemin <61978339+Kim-Jaemin420@users.noreply.github.com> Date: Fri, 9 Feb 2024 15:33:05 +0900 Subject: [PATCH] =?UTF-8?q?[#132]=20Fix:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=A0=84=20=EB=82=B4=20=EC=A0=95=EB=B3=B4=20=EC=9A=94=EC=B2=AD?= =?UTF-8?q?=20=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95=20(#133)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/core.ts | 5 ++++- src/assets/svg/big-activity.svg | 12 ++++++------ src/store/auth.ts | 7 +------ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/apis/core.ts b/src/apis/core.ts index 6aa9e10c..e3a60257 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 caf08468..a4733d3a 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 796dabfe..e84a1873 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(() => ({