Skip to content

Commit 4e0ec73

Browse files
committed
feat: add check for if email is verified
1 parent 17aa015 commit 4e0ec73

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

app/pages/account/settings.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ useFetch('/api/atproto/server-info').then(({ data }) => {
2020
}
2121
})
2222
23+
const isEmailUnverified = computed(() => {
24+
const session = user.value as { emailConfirmed?: boolean } | null | undefined
25+
26+
return session?.emailConfirmed === false
27+
})
28+
2329
function initiateHandleUpdate() {
2430
handleError.value = ''
2531
handleSuccess.value = ''
@@ -207,6 +213,14 @@ function cancelPasswordReset() {
207213
</div>
208214
</header>
209215

216+
<div
217+
v-if="isEmailUnverified"
218+
class="p-4 bg-yellow-500/10 border border-yellow-500/20 rounded-lg text-yellow-600 text-sm flex gap-2"
219+
>
220+
⚠️ Your account email is unverified. You must verify it on your provider before requesting
221+
email or password changes.
222+
</div>
223+
210224
<div class="flex flex-col gap-6">
211225
<section class="p-6 bg-bg-subtle border border-border rounded-lg">
212226
<h2 class="font-mono text-xl mb-2">Change Handle</h2>
@@ -318,7 +332,7 @@ function cancelPasswordReset() {
318332
<ButtonBase
319333
v-if="!isEmailCodeSent"
320334
variant="secondary"
321-
:disabled="isRequestingEmail"
335+
:disabled="isRequestingEmail || isEmailUnverified"
322336
@click="requestEmailChange"
323337
>
324338
{{ isRequestingEmail ? 'Requesting...' : 'Request Email Change' }}
@@ -377,7 +391,7 @@ function cancelPasswordReset() {
377391
<ButtonBase
378392
variant="secondary"
379393
class="text-red-500 mt-2"
380-
:disabled="isRequestingPassword || !passwordEmail"
394+
:disabled="isRequestingPassword || !passwordEmail || isEmailUnverified"
381395
@click="requestPasswordReset"
382396
>
383397
{{ isRequestingPassword ? 'Sending...' : 'Send Reset Code' }}

0 commit comments

Comments
 (0)