registra
This commit is contained in:
2
.env
Normal file
2
.env
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
VITE_SUPABASE_URL='https://edfzercujausbwfhhzls.supabase.co'
|
||||||
|
VITE_SUPABASE_ANON_KEY='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVkZnplcmN1amF1c2J3ZmhoemxzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzgxNTM1MzQsImV4cCI6MjA1MzcyOTUzNH0.1J-9b1npDm5pNSMaiLKGVXGsmLEtj9ic4IqS4GEKDm4'
|
||||||
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -11,5 +11,8 @@
|
|||||||
"javascriptreact",
|
"javascriptreact",
|
||||||
"typescript",
|
"typescript",
|
||||||
"vue"
|
"vue"
|
||||||
]
|
],
|
||||||
|
"[vue]": {
|
||||||
|
"editor.defaultFormatter": "Vue.volar"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,7 @@ export default defineConfig((/* ctx */) => {
|
|||||||
// --> boot files are part of "main.js"
|
// --> boot files are part of "main.js"
|
||||||
// https://v2.quasar.dev/quasar-cli-vite/boot-files
|
// https://v2.quasar.dev/quasar-cli-vite/boot-files
|
||||||
boot: [
|
boot: [
|
||||||
|
'supabase'
|
||||||
],
|
],
|
||||||
|
|
||||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#css
|
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#css
|
||||||
|
|||||||
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>
|
<template>
|
||||||
<q-page class="flex flex-center">
|
<q-page class="flex flex-center">
|
||||||
<img alt="Quasar logo" src="~assets/quasar-logo-vertical.svg" style="width: 200px; height: 200px">
|
<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>
|
</q-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted } from 'vue'
|
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>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user