registra
This commit is contained in:
11
src/boot/supabase.js
Normal file
11
src/boot/supabase.js
Normal 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 };
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user