show error
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</SMForm>
|
</SMForm>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else-if="!formError">
|
||||||
<h1 class="mb-4">Email Verified!</h1>
|
<h1 class="mb-4">Email Verified!</h1>
|
||||||
<p class="mb-4">Hurrah, Your email has been verified!</p>
|
<p class="mb-4">Hurrah, Your email has been verified!</p>
|
||||||
<div class="flex flex-justify-center items-center pt-4">
|
<div class="flex flex-justify-center items-center pt-4">
|
||||||
@@ -34,6 +34,21 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<h1 class="mb-4">Verification Error</h1>
|
||||||
|
<p class="mb-4">
|
||||||
|
A server error occurred verifying your email. The STEMMechanics
|
||||||
|
team have been notified and will fix the issue soon!
|
||||||
|
</p>
|
||||||
|
<div class="flex flex-justify-center items-center pt-4">
|
||||||
|
<router-link
|
||||||
|
role="button"
|
||||||
|
class="font-medium px-6 py-1.5 rounded-md hover:shadow-md transition text-sm bg-sky-600 hover:bg-sky-500 text-white cursor-pointer"
|
||||||
|
:to="{ name: 'login' }"
|
||||||
|
>Login</router-link
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -50,10 +65,11 @@ import SMLoading from "../components/SMLoading.vue";
|
|||||||
|
|
||||||
// const { executeRecaptcha, recaptchaLoaded } = useReCaptcha();
|
// const { executeRecaptcha, recaptchaLoaded } = useReCaptcha();
|
||||||
const formDone = ref(false);
|
const formDone = ref(false);
|
||||||
|
const formError = ref(false);
|
||||||
let form = reactive(
|
let form = reactive(
|
||||||
Form({
|
Form({
|
||||||
code: FormControl("", And([Required(), Min(6), Max(6)])),
|
code: FormControl("", And([Required(), Min(6), Max(6)])),
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
@@ -73,6 +89,7 @@ const handleSubmit = async () => {
|
|||||||
|
|
||||||
formDone.value = true;
|
formDone.value = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
formError.value = true;
|
||||||
form.apiErrors(error, (message) => {
|
form.apiErrors(error, (message) => {
|
||||||
useToastStore().addToast({
|
useToastStore().addToast({
|
||||||
title: "An error occurred",
|
title: "An error occurred",
|
||||||
|
|||||||
Reference in New Issue
Block a user