capturando url

This commit is contained in:
2025-02-01 10:41:11 +01:00
parent 7d0b5576e5
commit 94f2dcc832
2 changed files with 8 additions and 7 deletions

View File

@@ -11,17 +11,18 @@
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { ref, onBeforeMount } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const token = ref('')
onMounted(() => {
console.log(route)
console.log(route.fullPath)
//guardar en un objeto para sacar el token o el error
onBeforeMount(() => {
//http://localhost:9000/verify-email/#error=access_denied&error_code=otp_expired&error_description=Email+link+is+invalid+or+has+expired
let error = route.hash.split('=')[3].toString().replaceAll('+', ' ')
alert(error)
//http://localhost:9000/verify-email#access_token=eyJhbGciOiJIUzI1NiIsImtpZCI6IjV1bjU5SWxwZmJ0L0xXSkoiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2VkZnplcmN1amF1c2J3ZmhoemxzLnN1cGFiYXNlLmNvL2F1dGgvdjEiLCJzdWIiOiJhMzMwNjEyZi1jODg5LTQxY2YtYjhiYS1lZjkyNjdiNjc5OTIiLCJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNzM4NDA2MzU5LCJpYXQiOjE3Mzg0MDI3NTksImVtYWlsIjoia2V4b2c5NTczM0BhaGFrcy5jb20iLCJwaG9uZSI6IiIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6ImVtYWlsIiwicHJvdmlkZXJzIjpbImVtYWlsIl19LCJ1c2VyX21ldGFkYXRhIjp7ImVtYWlsIjoia2V4b2c5NTczM0BhaGFrcy5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwicGhvbmVfdmVyaWZpZWQiOmZhbHNlLCJzdWIiOiJhMzMwNjEyZi1jODg5LTQxY2YtYjhiYS1lZjkyNjdiNjc5OTIifSwicm9sZSI6ImF1dGhlbnRpY2F0ZWQiLCJhYWwiOiJhYWwxIiwiYW1yIjpbeyJtZXRob2QiOiJvdHAiLCJ0aW1lc3RhbXAiOjE3Mzg0MDI3NTl9XSwic2Vzc2lvbl9pZCI6IjY1ZmI5YjBjLTVhNTctNGM4Yi04N2FkLWJhZjcxYzlhNjczNCIsImlzX2Fub255bW91cyI6ZmFsc2V9.LXj1zLDQonsxOKQK5U1RCah5WmGs_TZgMpc_Wt-9wtY&expires_at=1738406359&expires_in=3600&refresh_token=xP5cmsv_jpgT3Re1yx8sNA&token_type=bearer&type=signup
})

View File

@@ -28,8 +28,8 @@ export default defineRouter(function (/* { store, ssrContext } */) {
// to hacia
// from desde
Router.beforeEach((to, from, next) => {
console.log(to)
console.log(from)
//console.log(to)
//console.log(from)
next()
})