From fb90403b7ca61c35d46396ffa0edd6fed97f7e8e Mon Sep 17 00:00:00 2001 From: chan Date: Thu, 18 Jun 2026 16:53:46 +0900 Subject: [PATCH] =?UTF-8?q?fix(auth):=20=EB=B9=84=EB=B0=80=EB=B2=88?= =?UTF-8?q?=ED=98=B8=20=EC=9E=AC=EC=84=A4=EC=A0=95=20=EB=A6=AC=EB=8B=A4?= =?UTF-8?q?=EC=9D=B4=EB=A0=89=ED=8A=B8=20=EC=96=B8=EC=96=B4=20=EB=B3=B4?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=EB=B3=84=20=EB=B6=84=EA=B8=B0=20=EC=B0=A8=EB=8B=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 백엔드 ProcessPasswordResetToken 리다이렉션 경로에 최우선 선호 로케일 주소(ko/en) 동적 생성 적용 (레이스 컨디션 방지 및 로딩 갇힘 해결) 2. ForgotPasswordScreen 발송 성공 후 빈 네비게이터 팝 현상 제거 (GoRouter context.pop() 및 context.go() 사용) 3. 로그인 후 화면(내정보 프로필 페이지)에서 불필요한 비밀번호 분실 버튼 제거 정책 반영 --- backend/internal/handler/auth_handler.go | 12 +++++++++++- .../auth/presentation/forgot_password_screen.dart | 15 ++++++++++++++- .../profile/presentation/pages/profile_page.dart | 5 ----- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/backend/internal/handler/auth_handler.go b/backend/internal/handler/auth_handler.go index 019b1656..dae3e471 100644 --- a/backend/internal/handler/auth_handler.go +++ b/backend/internal/handler/auth_handler.go @@ -4144,7 +4144,17 @@ func (h *AuthHandler) ProcessPasswordResetToken(c *fiber.Ctx) error { ale.LoginIDs["loginId_normalized"] = loginID userfrontURL := h.resolveUserfrontURL(c) - redirectBase, parseErr := url.Parse(userfrontURL + "/reset-password") + locale := "ko" + acceptLang := c.Get("Accept-Language") + if acceptLang != "" { + // Accept-Language 헤더는 선호도가 가장 높은 순서대로 쉼표로 구분되어 나열됩니다. (예: ko-KR,ko;q=0.9,en-US;q=0.8) + // 따라서 첫 번째 쉼표 이전의 가장 첫 번째 세그먼트가 사용자가 최우선으로 선호하는 언어입니다. + firstLang := strings.Split(acceptLang, ",")[0] + if strings.Contains(strings.ToLower(firstLang), "en") { + locale = "en" + } + } + redirectBase, parseErr := url.Parse(fmt.Sprintf("%s/%s/reset-password", strings.TrimRight(userfrontURL, "/"), locale)) if parseErr != nil { ale.Status = fiber.StatusInternalServerError ale.LatencyMs = time.Since(startTime) diff --git a/userfront/lib/features/auth/presentation/forgot_password_screen.dart b/userfront/lib/features/auth/presentation/forgot_password_screen.dart index 8c01e4cd..9b72a485 100644 --- a/userfront/lib/features/auth/presentation/forgot_password_screen.dart +++ b/userfront/lib/features/auth/presentation/forgot_password_screen.dart @@ -1,4 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import '../../../core/i18n/locale_utils.dart'; +import '../../../core/services/auth_token_store.dart'; import '../../../core/services/auth_proxy_service.dart'; import '../../../core/ui/toast_service.dart'; import 'package:userfront/i18n.dart'; @@ -48,7 +51,17 @@ class _ForgotPasswordScreenState extends State { ); if (mounted) { ToastService.success(tr('msg.userfront.forgot.sent')); - Navigator.of(context).pop(); + if (context.canPop()) { + context.pop(); + } else { + final isLoggedIn = AuthTokenStore.hasToken(); + final localeCode = extractLocaleFromPath(Uri.base) ?? resolvePreferredLocaleCode(); + if (isLoggedIn) { + context.go('/$localeCode/profile'); + } else { + context.go('/$localeCode/signin'); + } + } } } catch (e) { if (mounted) { diff --git a/userfront/lib/features/profile/presentation/pages/profile_page.dart b/userfront/lib/features/profile/presentation/pages/profile_page.dart index 4ed3e63b..d023365c 100644 --- a/userfront/lib/features/profile/presentation/pages/profile_page.dart +++ b/userfront/lib/features/profile/presentation/pages/profile_page.dart @@ -1097,11 +1097,6 @@ class _ProfilePageState extends ConsumerState { ) : Text(tr('ui.userfront.profile.password.change')), ), - const SizedBox(width: 12), - TextButton( - onPressed: () => context.go('/recovery'), - child: Text(tr('ui.userfront.profile.password.forgot')), - ), ], ), ],