Add:api-login
This commit is contained in:
parent
a6cddc6318
commit
c411f2a8a4
20 changed files with 434 additions and 185 deletions
|
|
@ -27,14 +27,22 @@ const forgotRules = {
|
|||
email: { rules: { required: true, email: true }, label: 'อีเมล' }
|
||||
}
|
||||
|
||||
const { requestPasswordReset } = useAuth()
|
||||
|
||||
const sendResetLink = async () => {
|
||||
if (!validate(forgotForm, forgotRules)) return
|
||||
|
||||
isLoading.value = true
|
||||
// Simulate API call
|
||||
await new Promise(resolve => setTimeout(resolve, 1500))
|
||||
|
||||
const result = await requestPasswordReset(forgotForm.email)
|
||||
|
||||
isLoading.value = false
|
||||
forgotStep.value = 'success'
|
||||
|
||||
if (result.success) {
|
||||
forgotStep.value = 'success'
|
||||
} else {
|
||||
alert(result.error || 'ไม่สามารถส่งลิงก์รีเซ็ตได้ กรุณาลองใหม่')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue