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",
component: VerifyEmail,
},

View file

@ -11,24 +11,24 @@ const $q = useQuasar();
const route = useRoute();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const pathApi = ref<string>(`${env.API_URI}/profile/verify-email`);
const token = ref(route.params.token);
const pathApi = ref<string>(`${env.API_URI}/org/unauthorize/verify-email`);
const token = ref(route.query.upn);
const isCheckEmail = ref<boolean>(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);
"
>
<div class="card">
<div>
<!-- <div class="header"> -->
<q-icon name="mdi-check-decagram" color="blue" size="64px" />
<div class="text-h4 text-primary q-mt-md">Verify Your Email</div>
<!-- <div class="text-subtitle2 text-grey-7 q-mt-xs">
Please check your inbox to confirm your email address.
</div> -->
<q-icon
:name="isCheckEmail ? 'mdi-check-decagram' : 'mdi-alert-decagram'"
:color="isCheckEmail ? 'blue' : 'warning'"
size="64px"
/>
<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> -->
<q-btn