From ba31453ff65bf11819b144617beed7656eed688f Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 22 Nov 2024 10:56:45 +0700 Subject: [PATCH] verifyEmail --- src/router/index.ts | 2 +- src/views/VerifyEmail.vue | 50 +++++++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 3e6cc89..103e994 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -79,7 +79,7 @@ const router = createRouter({ }, }, { - path: "/verifyemail/:token", + path: "/verifyemail", name: "verifyemail", component: VerifyEmail, }, diff --git a/src/views/VerifyEmail.vue b/src/views/VerifyEmail.vue index d9e2ed6..a0e04dc 100644 --- a/src/views/VerifyEmail.vue +++ b/src/views/VerifyEmail.vue @@ -11,24 +11,24 @@ const $q = useQuasar(); const route = useRoute(); const { showLoader, hideLoader, messageError } = useCounterMixin(); -const pathApi = ref(`${env.API_URI}/profile/verify-email`); -const token = ref(route.params.token); +const pathApi = ref(`${env.API_URI}/org/unauthorize/verify-email`); +const token = ref(route.query.upn); +const isCheckEmail = ref(false); async function fetchCheckVerifEemail() { + if (!token.value) { + return false; + } + showLoader(); await axios - .post( - pathApi.value, - { token: token.value }, - { - headers: { - "Content-Type": "application/json; charset=utf-8", - }, - } - ) - .then(() => {}) + .post(pathApi.value, { token: token.value }) + .then(() => { + isCheckEmail.value = true; + }) .catch((err) => { // messageError($q, err); + isCheckEmail.value = false; }) .finally(() => { hideLoader(); @@ -48,13 +48,27 @@ onMounted(() => { background: linear-gradient(to bottom, #e0f7fa, #ffffff); " > -
+
- -
Verify Your Email
- + +
+
Verify Your Email
+
+ Your email address has been successfully verified. Thank you! +
+
+
+
+ Email Verification Failed +
+
+ Something went wrong. Please try again or contact support. +
+