This commit is contained in:
2025-01-29 13:42:41 +01:00
parent 77e0a534ed
commit 0d4f41eb60
5 changed files with 37 additions and 6 deletions

11
src/boot/supabase.js Normal file
View File

@@ -0,0 +1,11 @@
import { createClient } from '@supabase/supabase-js';
const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;
const supabaseKey = import.meta.env.VITE_SUPABASE_ANON_KEY;
const supabase = createClient(supabaseUrl, supabaseKey);
//console.log('Init Supabase: ', supabase);
export default function useSupabase() {
return { supabase };
}

View File

@@ -1,16 +1,30 @@
<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="Primary" @click="registrar" />
</q-page>
</template>
<script setup>
import { onMounted } from 'vue'
import { supabaseStore } from '../stores/supabaseStore'
//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 () => {
}
)
const store = supabaseStore()
onMounted(() => {
console.log(store.prueba)
})
</script>