verifyemailpage

This commit is contained in:
2025-01-31 14:44:45 +01:00
parent 28c647cac2
commit 7d0b5576e5
6 changed files with 55 additions and 27 deletions

View File

@@ -41,7 +41,7 @@ export default defineConfig((/* ctx */) => {
node: 'node20'
},
vueRouterMode: 'hash', // available values: 'hash', 'history'
vueRouterMode: 'history', // available values: 'hash', 'history'
// vueRouterBase,
// vueDevtools,
// vueOptionsAPI: false,

View File

@@ -1,30 +1,17 @@
<template>
<q-page class="flex flex-center">
<img alt="Quasar logo" src="~assets/quasar-logo-vertical.svg" style="width: 200px; height: 200px">
<q-btn color="primary" label="Registrar" @click="registrar" />
<q-page>
<div class="bg-light-green window-height window-width row justify-center items-center">
<div class="column">
<div class="row"></div>
<h1>Página principal</h1>
</div>
</div>
</q-page>
</template>
<script setup>
import { onMounted } from 'vue'
//import { supabaseStore } from '../stores/supabaseStore'
//const store = supabaseStore()
import useSupabase from '../boot/supabase'
const { supabase } = useSupabase()
const registrar = async () => {
const { data, error } = await supabase.auth.signUp(
{
email: 'nedejih337@rykone.com',
password: 'nedejih337',
}
)
console.log(data, '\n', error)
}
onMounted(async () => {
}
)
//import useSupabase from '../boot/supabase'
//const { supabase } = useSupabase()
</script>

View File

@@ -70,7 +70,7 @@ const registrar = async () => {
email: email.value,
password: password.value,
options: {
emailRedirectTo: 'http://localhost:9000/verify-email/',
emailRedirectTo: 'http://localhost:9000/verify-email',
},
})
if (error) throw error

View File

@@ -0,0 +1,28 @@
<template>
<div class="bg-light-green window-height window-width row justify-center items-center">
<div class="column">
<div class="row"></div>
<h1>
Verify your email
</h1>
<h5>{{ token }}</h5>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } 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
})
</script>

View File

@@ -25,6 +25,13 @@ export default defineRouter(function (/* { store, ssrContext } */) {
// quasar.conf.js -> build -> publicPath
history: createHistory(process.env.VUE_ROUTER_BASE)
})
// to hacia
// from desde
Router.beforeEach((to, from, next) => {
console.log(to)
console.log(from)
next()
})
return Router
})

View File

@@ -1,10 +1,16 @@
const routes = [
{
path: '/',
component: () => import('pages/LoginPage.vue')
path: '/login',
component: () => import('pages/LoginPage.vue'),
name: 'login'
},
{
path: '/index',
path: '/verify-email',
component: () => import('pages/VerifyEmailPage.vue'),
name: 'verify-email'
},
{
path: '/',
component: () => import('layouts/MainLayout.vue'),
children: [
{ path: '', component: () => import('pages/IndexPage.vue') }