diff --git a/components/user/account.vue b/components/user/account.vue index 88a6795..938fd27 100644 --- a/components/user/account.vue +++ b/components/user/account.vue @@ -11,6 +11,8 @@ import { patch, post } from '#/src/api.js'; const pageContext = inject('pageContext'); const { user } = pageContext; +const allowEmailUpdate = pageContext.env.emailEnabled; + const credentials = reactive({ email: null, password: null, @@ -95,7 +97,7 @@ async function verifyEmail() { @@ -123,6 +127,7 @@ async function verifyEmail() { { href="/signup" class="link" >Create an account + + I forgot my password diff --git a/src/auth.js b/src/auth.js index c89ccd7..f4ac9c1 100755 --- a/src/auth.js +++ b/src/auth.js @@ -91,6 +91,10 @@ async function hashPassword(password) { } export async function sendEmailVerification(user, customEmail, trigger) { + if (!config.email.enabled) { + throw new HttpError('E-mail verification is disabled', 503); + } + if (!user) { throw new HttpError('No user provided', 401); }