Compare commits

...
2 Commits
5 changed files with 24 additions and 5 deletions
+7 -2
View File
@@ -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() {
<template #popper>
<div class="unverified-tooltip">
Your e-mail address is unverified
Your e-mail address is unverified.
<Ellipsis v-if="verifying" />
@@ -105,11 +107,13 @@ async function verifyEmail() {
>Verification e-mail sent</strong>
<button
v-else
v-else-if="allowEmailUpdate"
type="button"
class="button button-primary"
@click="verifyEmail"
>Verify now</button>
<span v-else>Verification is currently unavailable.</span>
</div>
</template>
</VDropdown>
@@ -123,6 +127,7 @@ async function verifyEmail() {
</span>
<input
v-if="allowEmailUpdate"
v-model="credentials.email"
type="email"
placeholder="New e-mail"
+2 -2
View File
@@ -1,11 +1,11 @@
{
"name": "traxxx-web",
"version": "0.56.0",
"version": "0.56.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"version": "0.56.0",
"version": "0.56.1",
"dependencies": {
"@brillout/json-serializer": "^0.5.25",
"@dicebear/collection": "7.0.5",
+1 -1
View File
@@ -91,7 +91,7 @@
"overrides": {
"vite": "$vite"
},
"version": "0.56.0",
"version": "0.56.1",
"imports": {
"#/*": "./*.js"
},
+10
View File
@@ -9,6 +9,10 @@ import navigate from '#/src/navigate.js';
const pageContext = inject('pageContext');
const user = pageContext.user;
const allowSignup = pageContext.env.allowSignup;
// const allowRecovery = pageContext.env.emailEnabled;
const allowRecovery = false; // TODO: implement
console.log(pageContext.env);
const username = ref('');
const password = ref('');
@@ -104,6 +108,12 @@ onMounted(() => {
href="/signup"
class="link"
>Create an account</a>
<a
v-if="allowRecovery"
href="/recovery"
class="link"
>I forgot my password</a>
</form>
</div>
</template>
+4
View File
@@ -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);
}