인증 요청 안정화와 월간 메일 한도 적용
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="./style/output.css?v=4.0.12" />
|
||||
<link rel="stylesheet" href="./style/output.css?v=4.0.14" />
|
||||
<title>이메일 인증 - UNIARE</title>
|
||||
</head>
|
||||
<body class="app-page">
|
||||
@@ -21,12 +21,13 @@
|
||||
<form id="resend-form" class="mt-6">
|
||||
<label class="mb-1.5 block text-left text-xs font-bold uppercase tracking-wider text-slate-400" for="email">이메일</label>
|
||||
<input type="email" id="email" required autocomplete="email" class="box-border block w-full rounded-xl border border-slate-200 bg-white px-4 py-3 text-sm text-slate-900 outline-none transition focus:border-blue-500 focus:ring-2 focus:ring-blue-500/15" />
|
||||
<button type="submit" class="mt-4 block w-full cursor-pointer rounded-xl border-0 bg-slate-100 px-4 py-3 text-sm font-bold text-slate-700 transition hover:bg-slate-200">인증 메일 다시 보내기</button>
|
||||
<button type="submit" id="resend-submit" class="mt-4 block w-full cursor-pointer rounded-xl border-0 bg-slate-100 px-4 py-3 text-sm font-bold text-slate-700 transition hover:bg-slate-200 disabled:cursor-wait disabled:opacity-70">인증 메일 다시 보내기</button>
|
||||
</form>
|
||||
<a href="/login.html" class="mt-5 inline-block text-sm font-bold text-blue-600 hover:underline">로그인으로 이동</a>
|
||||
</section>
|
||||
</main>
|
||||
<script src="/script/api.js"></script>
|
||||
<script src="/script/api.js?v=4.0.14"></script>
|
||||
<script src="/script/auth-form.js?v=4.0.14"></script>
|
||||
<script>
|
||||
const params = new URLSearchParams(location.search);
|
||||
const token = params.get('token');
|
||||
@@ -44,7 +45,9 @@
|
||||
document.getElementById('resend-form').classList.add('hidden');
|
||||
statusEl.textContent = '이메일을 인증하는 중입니다...';
|
||||
try {
|
||||
const result = await UaDeckApi.verifyEmail(token);
|
||||
const result = typeof UaDeckApi.verifyEmail === 'function'
|
||||
? await UaDeckApi.verifyEmail(token)
|
||||
: await UaAuthForm.request('/auth/verify-email', { token });
|
||||
statusEl.textContent = result.message;
|
||||
} catch (err) {
|
||||
statusEl.textContent = err.message;
|
||||
@@ -54,11 +57,24 @@
|
||||
|
||||
document.getElementById('resend-form').addEventListener('submit', async (event) => {
|
||||
event.preventDefault();
|
||||
const submitButton = document.getElementById('resend-submit');
|
||||
if (submitButton.disabled) return;
|
||||
UaAuthForm.setLoading(submitButton, true, '전송 중...');
|
||||
let sent = false;
|
||||
try {
|
||||
const result = await UaDeckApi.resendVerification(emailEl.value);
|
||||
const result = typeof UaDeckApi.resendVerification === 'function'
|
||||
? await UaDeckApi.resendVerification(emailEl.value)
|
||||
: await UaAuthForm.request('/auth/resend-verification', { email: emailEl.value });
|
||||
statusEl.textContent = result.message;
|
||||
sent = true;
|
||||
} catch (err) {
|
||||
statusEl.textContent = err.message;
|
||||
} finally {
|
||||
if (sent) {
|
||||
UaAuthForm.startCooldown(submitButton, 60, '다시 보내기');
|
||||
} else {
|
||||
UaAuthForm.setLoading(submitButton, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
verifyToken();
|
||||
|
||||
Reference in New Issue
Block a user