-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9bd9139
commit b3f8cf1
Showing
6 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,44 @@ | ||
<script setup> | ||
</script> | ||
|
||
<template> | ||
<h1>Взять хэш из GET PARAMS и отправить GET запрос с HASH на VERIFY HASH</h1> | ||
</template> | ||
|
||
|
||
<script setup> | ||
import {useRoute} from "vue-router"; | ||
import {useAuthStore} from "@/store/AuthStore.js"; | ||
import router from "@/router/router.js"; | ||
import axiosJwtApi from "@/Axios/Api.js"; | ||
import {onMounted} from "vue"; | ||
const route = useRoute(); | ||
const authStore = useAuthStore(); | ||
const url = `${authStore.appDomain}${authStore.apiVersion}/auth/email/verify/${route.params.id}/${route.params.hash}?expires=${route.query.expires}&signature=${route.query.signature}`; | ||
const verifyEmailRequest = async () => { | ||
if (!authStore.auth) { | ||
await router.push('/login') | ||
} else if (authStore.userInfo.value.email_verified) { | ||
await router.push('/') | ||
} | ||
try { | ||
const response = await axiosJwtApi.get(url) | ||
authStore.userInfo.value.email_verified = true | ||
localStorage.setItem('userInfo', JSON.stringify(authStore.userInfo)) | ||
await router.push('/') | ||
} catch (err) { | ||
console.log(err) | ||
} | ||
} | ||
onMounted(() => { | ||
verifyEmailRequest() | ||
}) | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters