From 7660c3b574512c5fe7ec235498e00a47ad3db87e Mon Sep 17 00:00:00 2001 From: Mina Choi Date: Fri, 4 Sep 2026 16:54:41 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20solution/frontend:=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=C2=B7=EA=B0=80=EC=9E=85=20=EC=A7=81=ED=9B=84=EC=97=94?= =?UTF-8?q?=20=EB=82=B4=20=EC=82=AC=EC=9D=B4=ED=8A=B8=EB=A1=9C=20=E2=80=94?= =?UTF-8?q?=20'/'=20=EB=8A=94=20=EC=9D=B4=EC=A0=9C=20=EB=9E=9C=EB=94=A9?= =?UTF-8?q?=EC=9D=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit '/' 를 로그인 여부와 무관하게 랜딩으로 바꾸면서, 로그인 기본 도착지가 '/' 인 채로 남아 방금 로그인한 사장님이 판매 화면을 보게 됐다. - LoginPage: 기본 도착지를 selfServe 면 /sites. 내부 운영 앱은 '/' 가 자기 홈으로 가므로 그대로 - SignupPage: 가입 직후도 /sites --- solution/frontend/src/pages/LoginPage.tsx | 8 +++++--- solution/frontend/src/pages/SignupPage.tsx | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/solution/frontend/src/pages/LoginPage.tsx b/solution/frontend/src/pages/LoginPage.tsx index b4c69ce..dfbd812 100644 --- a/solution/frontend/src/pages/LoginPage.tsx +++ b/solution/frontend/src/pages/LoginPage.tsx @@ -27,9 +27,11 @@ export function LoginPage({selfServe = true}: {selfServe?: boolean}) { const [password, setPassword] = useState('1234'); const [isSubmitting, setIsSubmitting] = useState(false); - // ★ 기본 도착지를 '/' 로 둔다. 앱마다 홈이 다르고(사장님 → 빌더, 내부 → 사업장 목록) - // 각 라우터의 '/' 리다이렉트가 이미 그걸 안다. 여기 경로를 박으면 한쪽에서 404 다. - const from = (location.state as {from?: string} | null)?.from ?? '/'; + // ★ 로그인을 마친 사람의 용건은 "내 것"이다 — 사장님 앱은 /sites 로 보낸다. + // '/' 로 보내면 방금 로그인해 놓고 랜딩(판매 화면)을 보게 된다. + // 내부 운영 앱은 '/' 가 자기 홈으로 리다이렉트하므로 그대로 둔다. + const home = selfServe ? '/sites' : '/'; + const from = (location.state as {from?: string} | null)?.from ?? home; if (user) return ; diff --git a/solution/frontend/src/pages/SignupPage.tsx b/solution/frontend/src/pages/SignupPage.tsx index 4d2691b..3ffad7a 100644 --- a/solution/frontend/src/pages/SignupPage.tsx +++ b/solution/frontend/src/pages/SignupPage.tsx @@ -76,7 +76,8 @@ export function SignupPage() { return; } notify.success('가입이 완료되었습니다.'); - navigate('/', {replace: true}); + // 가입 직후 갈 곳도 내 것이다 — '/' 는 판매 화면(랜딩)이다. + navigate('/sites', {replace: true}); } catch (error) { notifyApiError(error, '가입하지 못했습니다.'); } finally { @@ -97,7 +98,8 @@ export function SignupPage() { notifyApiError({data: res}, '로그인 응답에 토큰이 없습니다.'); return; } - navigate('/', {replace: true}); + // 가입 직후 갈 곳도 내 것이다 — '/' 는 판매 화면(랜딩)이다. + navigate('/sites', {replace: true}); } catch (error) { notifyApiError(error, '구글로 가입하지 못했습니다.'); } finally {