2단계 인증은 7.0.6 에서 서버측이 갖춰졌지만 인증번호를 입력할 화면이 어느 버전에도
없었다. 그래서 그 설정을 켠 사이트는 관리자를 포함한 전원이 로그인할 수 없었다.
원인은 `POST /api/auth/login` 이 조건에 따라 **다른 형태의 200** 을 돌려준다는 것이다.
평소에는 `{token, user}` 지만 2단계 인증이 켜져 있으면 `{two_factor_required,
challenge_id, ...}` 를 돌려준다. 프론트는 앞의 형태만 선언하고 `response.data.user.language`
를 바로 읽었으므로 그 자리에서 TypeError 가 났고, 영문 원문이 로그인 화면에 그대로 노출됐다.
서버는 정상 응답했으므로 서버 로그에는 아무 흔적도 남지 않는다.
이어서 `setToken(undefined)` 가 `localStorage` 에 문자열 `"undefined"` 를 남겼다.
이 값은 truthy 라 이후 모든 요청이 `Bearer undefined` 로 나가 401 이 되고, 사용자에게는
「세션이 만료되었습니다」로 보인다. 관리자 로그인은 한발 더 나가 `null->isAdmin` 으로
500 이 되어, 설정을 되돌릴 수단까지 함께 사라졌다.
## 구현
- 로그인 응답을 판별 유니온(`LoginResult`)으로 표현하고, 형태를 판별한 뒤에 읽는다.
`ApiClient.setToken` 은 비어 있지 않은 문자열만 저장한다.
- 사용자·관리자 로그인 화면에 인증번호 입력 단계를 추가했다. 같은 카드 안에서 넘어가며
「인증번호 다시 받기」와 「처음부터」를 제공한다. 관리자 판정은 코드 확인에 성공한 뒤에
수행하고, 거부할 때는 그 직전에 발급된 토큰을 회수한다.
- 재발송(`login/two-factor/resend`)은 기존 challenge 를 취소하고 새로 발행한다. 유효한
코드를 여러 개 살려 두면 대입 시도의 표적이 넓어진다.
- 인증번호를 보내지 못하면 401 이 아니라 503 으로 답한다. 자격 증명은 올바른데 401 로
뭉개면 사용자는 비밀번호를 의심하며 같은 시도를 반복하고, 운영자는 메일 설정이 깨진
사실을 알 방법이 없다.
- 공개 본인인증 경로(`identity/verify`·`cancel`)가 로그인 목적의 challenge 를 소진하지
못하도록 403 게이트를 세웠다. 소진되면 그 challenge 로 영영 로그인할 수 없다.
- 로그인 시도 제한 429 응답이 다국어 문구를 싣도록 했다(종전에는 프레임워크 기본 영문).
- 다국어 파라미터에서 파이프 표현식이 평가되지 않아 「유효시간 까지」처럼 값이 빠지던
문제를 함께 고쳤다. 같은 결함이 문의 목록 화면에도 있었다.
## 이번 점검에서 함께 고친 것
- 계정 잠금(423)·발송 실패(503) 응답이 사용자·관리자 컨트롤러에 동일하게 복제돼 있었고
그 주석 자신은 "단일 지점에서 만든다" 고 적혀 있었다. 페이로드에 필드가 하나 추가되면
한쪽만 따라가 같은 실패를 두 화면이 다르게 안내하게 된다 — 트레이트로 통합했다.
- 테스트가 개발자 자신의 사이트 설정을 읽고 있었다. 2단계 인증을 켜 둔 환경에서는 로그인
성공을 전제한 테스트가 503 으로 깨지는데 실패 메시지가 원인을 가리키지도 않는다.
같은 결함군을 위해 이미 존재하던 단일 지점에 그 축을 추가했다.
## 버전
코어 7.0.11 · sirsoft-basic 1.1.4 · sirsoft-admin_basic 1.0.9 ·
번들 일본어팩 3종 · 템플릿 엔진 engine-v1.65.0.
167 lines
6.1 KiB
JSON
167 lines
6.1 KiB
JSON
{
|
|
"login": "Login",
|
|
"logout": "Logout",
|
|
"register_link": "Sign Up",
|
|
"or": "or",
|
|
"already_member": "Already a member?",
|
|
"forgot_password_link": "Forgot your password?",
|
|
"social": {
|
|
"login_with": "Sign in with {{provider}}",
|
|
"register_with": "Sign up with {{provider}}"
|
|
},
|
|
"email": "Email",
|
|
"email_placeholder": "Enter your email address",
|
|
"password": "Password",
|
|
"password_placeholder": "Enter your password",
|
|
"password_hint": "At least {{count}} characters",
|
|
"password_confirm": "Confirm Password",
|
|
"password_confirm_placeholder": "Re-enter your password",
|
|
"name": "Name",
|
|
"name_placeholder": "Enter your name",
|
|
"nickname": "Nickname",
|
|
"nickname_placeholder": "Enter your nickname (optional)",
|
|
"mobile": "Mobile",
|
|
"mobile_placeholder": "Enter your mobile number (optional)",
|
|
"phone": "Phone",
|
|
"phone_placeholder": "Enter your phone number (optional)",
|
|
"language": "Language",
|
|
"language_select": "Select language",
|
|
"language_ko": "한국어",
|
|
"language_en": "English",
|
|
"terms": "Terms of Service",
|
|
"privacy": "Privacy Policy",
|
|
"agree_required": " (Required)",
|
|
"login_success": "Logged in successfully.",
|
|
"register_success": "Registration completed successfully.",
|
|
"login_processing": "Logging in...",
|
|
"already_logged_in": "You are already logged in.",
|
|
"redirecting_to_home": "Redirecting to home page...",
|
|
"guest_checkout": {
|
|
"divider": "or",
|
|
"continue": "Continue as guest",
|
|
"hint": "You can place an order without signing up."
|
|
},
|
|
"login_form": {
|
|
"title": "Login",
|
|
"subtitle": "Sign in to your account",
|
|
"email": "Email",
|
|
"email_placeholder": "Enter your email address",
|
|
"password": "Password",
|
|
"password_placeholder": "Enter your password",
|
|
"remember": "Remember me",
|
|
"submit": "Login",
|
|
"processing": "Logging in...",
|
|
"forgot_password": "Forgot your password?",
|
|
"no_account": "Don't have an account?",
|
|
"register_link": "Sign Up",
|
|
"social": {
|
|
"or": "or",
|
|
"google": "Sign in with Google",
|
|
"kakao": "Sign in with Kakao",
|
|
"naver": "Sign in with Naver"
|
|
},
|
|
"error": {
|
|
"invalid": "Invalid email or password.",
|
|
"email_required": "Please enter your email.",
|
|
"email_invalid": "Please enter a valid email address.",
|
|
"password_required": "Please enter your password."
|
|
}
|
|
},
|
|
"register": {
|
|
"title": "Sign Up",
|
|
"subtitle": "Create a new account",
|
|
"email": "Email",
|
|
"email_placeholder": "Enter your email address",
|
|
"password": "Password",
|
|
"password_placeholder": "Password ({{count}}+ characters)",
|
|
"password_confirm": "Confirm Password",
|
|
"password_confirm_placeholder": "Re-enter your password",
|
|
"nickname": "Nickname",
|
|
"nickname_placeholder": "Enter your nickname",
|
|
"terms_agree": "I agree to the Terms of Service.",
|
|
"privacy_agree": "I agree to the Privacy Policy.",
|
|
"submit": "Sign Up",
|
|
"processing": "Signing up...",
|
|
"has_account": "Already have an account?",
|
|
"login_link": "Login",
|
|
"error": {
|
|
"email_required": "Please enter your email.",
|
|
"email_invalid": "Please enter a valid email address.",
|
|
"email_exists": "This email is already in use.",
|
|
"password_required": "Please enter your password.",
|
|
"password_min": "Password must be at least {{count}} characters.",
|
|
"password_mismatch": "Passwords do not match.",
|
|
"nickname_required": "Please enter your nickname.",
|
|
"terms_required": "Please agree to the Terms of Service."
|
|
}
|
|
},
|
|
"forgot_password": {
|
|
"title": "Forgot Password",
|
|
"subtitle": "We'll send you a password reset link via email",
|
|
"email": "Email",
|
|
"email_placeholder": "Enter your registered email address",
|
|
"submit": "Send Reset Link",
|
|
"processing": "Sending...",
|
|
"success": "Password reset email has been sent.",
|
|
"back_to_login": "Back to Login"
|
|
},
|
|
"reset_password": {
|
|
"title": "Reset Password",
|
|
"subtitle": "Enter your new password",
|
|
"password": "New Password",
|
|
"password_placeholder": "New password ({{count}}+ characters)",
|
|
"password_confirm": "Confirm Password",
|
|
"password_confirm_placeholder": "Re-enter your new password",
|
|
"submit": "Change Password",
|
|
"processing": "Changing...",
|
|
"success": "Your password has been changed.",
|
|
"token_invalid": "This link is invalid or has expired. Please request a new password reset.",
|
|
"go_to_login": "Login",
|
|
"go_to_home": "Home"
|
|
},
|
|
"logged_in_redirect": {
|
|
"title": "Already logged in",
|
|
"message": "To change your password, please proceed from My Page.",
|
|
"change_password": "Change Password",
|
|
"go_home": "Go to Home"
|
|
},
|
|
"different_account": {
|
|
"title": "Different account",
|
|
"message": "This password reset link is for a different account. Please log out and try again.",
|
|
"logout": "Log out and continue",
|
|
"logging_out": "Logging out...",
|
|
"logout_failed": "Logout failed. Please try again.",
|
|
"go_home": "Go to Home"
|
|
},
|
|
"password_input": {
|
|
"show": "Show password",
|
|
"hide": "Hide password",
|
|
"match": "Passwords match",
|
|
"mismatch": "Passwords do not match",
|
|
"caps_lock_on": "CapsLock is on",
|
|
"rules": {
|
|
"minLength": "At least {{count}} characters",
|
|
"maxLength": "Maximum {{count}} characters",
|
|
"hasUppercase": "Contains uppercase letter",
|
|
"hasLowercase": "Contains lowercase letter",
|
|
"hasNumber": "Contains number",
|
|
"hasSpecial": "Contains special character",
|
|
"noSpaces": "No spaces allowed",
|
|
"minTypes": "At least {{count}} types (uppercase, lowercase, number, special)"
|
|
}
|
|
},
|
|
"two_factor": {
|
|
"sent": "We sent a verification code. Enter it to finish signing in.",
|
|
"resent": "We sent a new verification code. Enter the new code.",
|
|
"code_label": "Verification code",
|
|
"code_placeholder": "Enter the code you received",
|
|
"valid_until": "Valid until {{until}}",
|
|
"verify": "Verify code",
|
|
"verifying": "Verifying...",
|
|
"resend": "Resend code",
|
|
"restart": "Start over"
|
|
},
|
|
"locked_until": "Unlocks at {{until}}",
|
|
"locked_permanent": "Contact an administrator to unlock your account.",
|
|
"session_expired_toast": "Your session has expired. Please log in again."
|
|
} |