v0.1.48 - 인증 메일 재전송과 TODO 정리
This commit is contained in:
46
src/App.vue
46
src/App.vue
@@ -25,6 +25,7 @@ import {
|
||||
persistAuthState,
|
||||
readAuthState,
|
||||
requestPasswordReset,
|
||||
requestVerification,
|
||||
signup,
|
||||
updatePassword,
|
||||
updateProfile,
|
||||
@@ -1635,6 +1636,28 @@ async function submitAuthForm() {
|
||||
}
|
||||
}
|
||||
|
||||
async function resendVerificationEmail() {
|
||||
const email = authForm.email.trim()
|
||||
|
||||
if (!email || !email.includes('@')) {
|
||||
authMessage.value = '인증 메일을 다시 받으려면 이메일 주소를 먼저 입력해 주세요.'
|
||||
return
|
||||
}
|
||||
|
||||
authBusy.value = true
|
||||
|
||||
try {
|
||||
const result = await requestVerification({ email }, authToken.value || undefined)
|
||||
authMessage.value = result.verificationPreviewUrl
|
||||
? `${result.message} 개발용 링크: ${result.verificationPreviewUrl}`
|
||||
: result.message
|
||||
} catch (error) {
|
||||
authMessage.value = toUserFacingApiError(error, '인증 메일을 다시 보내지 못했습니다.')
|
||||
} finally {
|
||||
authBusy.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function restoreAuthSession() {
|
||||
const savedAuth = readAuthState()
|
||||
|
||||
@@ -3248,17 +3271,18 @@ onBeforeUnmount(() => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AuthDialog
|
||||
:open="authDialogOpen"
|
||||
:mode="authMode"
|
||||
:form="authForm"
|
||||
:busy="authBusy"
|
||||
:message="authMessage"
|
||||
@close="closeAuthDialog"
|
||||
@submit="submitAuthForm"
|
||||
@switch-mode="authMode = $event; authMessage = ''"
|
||||
@update:field="updateAuthField"
|
||||
/>
|
||||
<AuthDialog
|
||||
:open="authDialogOpen"
|
||||
:mode="authMode"
|
||||
:form="authForm"
|
||||
:busy="authBusy"
|
||||
:message="authMessage"
|
||||
@close="closeAuthDialog"
|
||||
@submit="submitAuthForm"
|
||||
@resend-verification="resendVerificationEmail"
|
||||
@switch-mode="authMode = $event; authMessage = ''"
|
||||
@update:field="updateAuthField"
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="printDialogOpen"
|
||||
|
||||
@@ -25,6 +25,7 @@ const props = defineProps({
|
||||
const emit = defineEmits([
|
||||
'close',
|
||||
'submit',
|
||||
'resend-verification',
|
||||
'switch-mode',
|
||||
'update:field',
|
||||
])
|
||||
@@ -210,6 +211,16 @@ function getSubmitLabel(mode, busy) {
|
||||
비밀번호를 잊으셨나요?
|
||||
</button>
|
||||
|
||||
<button
|
||||
v-if="mode === 'login'"
|
||||
type="button"
|
||||
class="mt-3 w-full text-center text-xs font-bold tracking-[0.14em] text-stone-500 underline underline-offset-4 transition hover:text-stone-900"
|
||||
:disabled="busy"
|
||||
@click="emit('resend-verification')"
|
||||
>
|
||||
이메일 인증 메일 다시 보내기
|
||||
</button>
|
||||
|
||||
<div class="mt-5 flex items-center justify-center gap-2 border-t border-stone-300/70 pt-4">
|
||||
<p class="text-sm font-semibold text-stone-600">
|
||||
{{ mode === 'signup' ? '이미 계정이 있나요?' : '계정 화면으로 돌아갈까요?' }}
|
||||
|
||||
@@ -143,3 +143,11 @@ export async function confirmVerification({ token }) {
|
||||
body: { token },
|
||||
})
|
||||
}
|
||||
|
||||
export async function requestVerification({ email }, token) {
|
||||
return request('/api/auth/verification/request', {
|
||||
method: 'POST',
|
||||
token,
|
||||
body: email ? { email } : {},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user