전화번호 로그인 요청/응답 처리

This commit is contained in:
2026-04-10 11:01:16 +09:00
parent 8fe4caa9a9
commit 022594f8dc
4 changed files with 216 additions and 99 deletions

View File

@@ -43,10 +43,10 @@ function updateUI() {
}
passwordField.classList.add('hidden');
inputHint.textContent = '전화번호가 확인되었습니다. 인증링크 발송 흐름을 사용할 수 있습니다.';
inputHint.textContent = '전화번호가 확인되었습니다. SSO 인증링크 발송할 수 있습니다.';
submitButton.textContent = '인증링크 발송';
submitButton.disabled = value.replace(/\D/g, '').length < 10;
statusText.textContent = '인증링크 발송 단계를 준비했습니다.';
statusText.textContent = '전화번호 기반 SSO 인증 단계를 준비했습니다.';
} else if (mode === 'employee') {
passwordField.classList.remove('hidden');
inputHint.textContent = 'ID 입력이 확인되었습니다. 비밀번호를 입력해 로그인하세요.';
@@ -74,6 +74,9 @@ loginForm.addEventListener('submit', async (e) => {
submitButton.disabled = true;
const originalBtnText = submitButton.textContent;
submitButton.textContent = '처리 중...';
if (currentMode === 'phone') {
statusText.textContent = '휴대폰으로 인증링크를 발송하고 승인 완료를 기다리고 있습니다.';
}
try {
let response;
@@ -98,11 +101,13 @@ loginForm.addEventListener('submit', async (e) => {
statusDisplay.classList.add('hidden');
successPanel.classList.remove('hidden');
successTitle.textContent = currentMode === 'phone' ? '인증링크 발송 완료' : '로그인 성공';
successDescription.textContent = currentMode === 'phone'
? `${identifier} 번호로 인증 링크를 보냈습니다.`
: `${identifier} 계정으로 접속되었습니다. 잠시 후 홈 화면으로 이동합니다...`;
if (currentMode === 'phone') {
successTitle.textContent = '전화번호 인증 완료';
successDescription.textContent = result.message || `${identifier} 번호의 SSO 인증이 완료되었습니다.`;
} else {
successTitle.textContent = '로그인 성공';
successDescription.textContent = `${identifier} 계정으로 접속되었습니다. 잠시 후 홈 화면으로 이동합니다...`;
}
if (result.redirectTo) {
setTimeout(() => {
window.location.href = result.redirectTo;

View File

@@ -11,7 +11,7 @@
<article class="login-panel">
<div class="panel-heading">
<h1>PM 데모 로그인</h1>
<p>숫자만 입력하면 전화번호 인증, 그 외 입력은 ID/PW 로그인으로 전환됩니다.</p>
<p>숫자만 입력하면 전화번호 SSO 인증, 그 외 입력은 ID/PW 로그인으로 전환됩니다.</p>
</div>
<form id="login-form" class="login-form">