more debug on signin

This commit is contained in:
Michael Dausmann
2023-05-03 23:01:44 +10:00
parent 10bfd30be6
commit 3a854d49c4

View File

@@ -9,6 +9,7 @@
const password = ref('')
const handleStandardSignin = async () => {
console.log(`handleStandardSignin email.value:${email.value}, password.value:${password.value}`);
try {
loading.value = true
const { error } = await supabase.auth.signInWithPassword({ email: email.value, password: password.value })
@@ -20,6 +21,20 @@
}
}
const handleGoogleSignin = async () => {
console.log('handleGoogleSignin');
try {
loading.value = true
const { error } = await supabase.auth.signInWithOAuth({ provider: 'google' })
if (error) throw error
} catch (error) {
alert(error)
} finally {
loading.value = false
}
}
watchEffect(async () => {
if (user.value) {
await accountStore.init();
@@ -46,7 +61,7 @@
class="w-full py-2 text-white bg-indigo-600 rounded-md hover:bg-indigo-700">Sign in</button>
</form>
<p class="text-center">or</p>
<button @click="supabase.auth.signInWithOAuth({ provider: 'google' })"
<button @click="handleGoogleSignin()"
class="w-full py-2 text-white bg-red-600 rounded-md hover:bg-red-700">
<span class="flex items-center justify-center space-x-2">
<Icon name="fa-brands:google" class="w-5 h-5" />