diff --git a/src/actions/user-check-action.ts b/src/actions/user-check-action.ts index fbadd99..62993cb 100644 --- a/src/actions/user-check-action.ts +++ b/src/actions/user-check-action.ts @@ -21,16 +21,19 @@ const userCheckAction = async (token: string) => { // 유저 정보 받아와서 image null 처리 const resUser: IUser = await response.json(); resUser.image = resUser.image || ""; + return { status: true, user: resUser, error: "", + token: token, }; } catch (err) { return { status: false, user: null, error: `${(err as Error).message}`, + token: null, }; } }; diff --git a/src/actions/user-signin-action.ts b/src/actions/user-signin-action.ts index 01fcb76..757dcee 100644 --- a/src/actions/user-signin-action.ts +++ b/src/actions/user-signin-action.ts @@ -24,32 +24,22 @@ const userSignInAction = async (_: any, formData: FormData) => { // 토큰 받아오기 실패 if (!response.ok) { const errorText = await response.text(); - console.error("API 응답 오류:", errorText); throw new Error(errorText); } - // 토큰을 받아오면 쿠키에 저장 const res = await response.json(); // 유저 정보 확인 - const chkResult = await userCheckAction(res.token); - - // 유저 정보 확인 성공 - if (!chkResult.status) { - throw new Error(chkResult.error); - } + const state = await userCheckAction(res.token); // 성공시 유저 정보 반환 - return { - status: true, - error: "", - user: chkResult.user, - }; + return state; } catch (err) { return { status: false, error: `${(err as Error).message}`, user: null, + token: null, }; } }; diff --git a/src/app/gathering/detail/[id]/_components/GatheringDetailInformation.tsx b/src/app/gathering/detail/[id]/_components/GatheringDetailInformation.tsx index 8a23bc5..0a6743f 100644 --- a/src/app/gathering/detail/[id]/_components/GatheringDetailInformation.tsx +++ b/src/app/gathering/detail/[id]/_components/GatheringDetailInformation.tsx @@ -32,7 +32,9 @@ const GatheringDetailInformation = ({
{name}
-{location}
++ {location === "홍대입구" ? "온라인" : location} +