verifyEmail

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-22 10:56:45 +07:00
parent 4a8bad8002
commit ba31453ff6
2 changed files with 33 additions and 19 deletions

View file

@ -79,7 +79,7 @@ const router = createRouter({
}, },
}, },
{ {
path: "/verifyemail/:token", path: "/verifyemail",
name: "verifyemail", name: "verifyemail",
component: VerifyEmail, component: VerifyEmail,
}, },

View file

@ -11,24 +11,24 @@ const $q = useQuasar();
const route = useRoute(); const route = useRoute();
const { showLoader, hideLoader, messageError } = useCounterMixin(); const { showLoader, hideLoader, messageError } = useCounterMixin();
const pathApi = ref<string>(`${env.API_URI}/profile/verify-email`); const pathApi = ref<string>(`${env.API_URI}/org/unauthorize/verify-email`);
const token = ref(route.params.token); const token = ref(route.query.upn);
const isCheckEmail = ref<boolean>(false);
async function fetchCheckVerifEemail() { async function fetchCheckVerifEemail() {
if (!token.value) {
return false;
}
showLoader(); showLoader();
await axios await axios
.post( .post(pathApi.value, { token: token.value })
pathApi.value, .then(() => {
{ token: token.value }, isCheckEmail.value = true;
{ })
headers: {
"Content-Type": "application/json; charset=utf-8",
},
}
)
.then(() => {})
.catch((err) => { .catch((err) => {
// messageError($q, err); // messageError($q, err);
isCheckEmail.value = false;
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -48,13 +48,27 @@ onMounted(() => {
background: linear-gradient(to bottom, #e0f7fa, #ffffff); background: linear-gradient(to bottom, #e0f7fa, #ffffff);
" "
> >
<div class="card"> <div>
<!-- <div class="header"> --> <!-- <div class="header"> -->
<q-icon name="mdi-check-decagram" color="blue" size="64px" /> <q-icon
<div class="text-h4 text-primary q-mt-md">Verify Your Email</div> :name="isCheckEmail ? 'mdi-check-decagram' : 'mdi-alert-decagram'"
<!-- <div class="text-subtitle2 text-grey-7 q-mt-xs"> :color="isCheckEmail ? 'blue' : 'warning'"
Please check your inbox to confirm your email address. size="64px"
</div> --> />
<div v-if="isCheckEmail">
<div class="text-h4 text-primary q-mt-md">Verify Your Email</div>
<div class="text-subtitle2 text-grey-7 q-mt-xs">
Your email address has been successfully verified. Thank you!
</div>
</div>
<div v-else>
<div class="text-h4 text-negative q-mt-md">
Email Verification Failed
</div>
<div class="text-subtitle2 text-grey-7 q-mt-xs">
Something went wrong. Please try again or contact support.
</div>
</div>
<!-- </div> --> <!-- </div> -->
<q-btn <q-btn