more debug on signin
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
const password = ref('')
|
const password = ref('')
|
||||||
|
|
||||||
const handleStandardSignin = async () => {
|
const handleStandardSignin = async () => {
|
||||||
|
console.log(`handleStandardSignin email.value:${email.value}, password.value:${password.value}`);
|
||||||
try {
|
try {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
const { error } = await supabase.auth.signInWithPassword({ email: email.value, password: password.value })
|
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 () => {
|
watchEffect(async () => {
|
||||||
if (user.value) {
|
if (user.value) {
|
||||||
await accountStore.init();
|
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>
|
class="w-full py-2 text-white bg-indigo-600 rounded-md hover:bg-indigo-700">Sign in</button>
|
||||||
</form>
|
</form>
|
||||||
<p class="text-center">or</p>
|
<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">
|
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">
|
<span class="flex items-center justify-center space-x-2">
|
||||||
<Icon name="fa-brands:google" class="w-5 h-5" />
|
<Icon name="fa-brands:google" class="w-5 h-5" />
|
||||||
|
|||||||
Reference in New Issue
Block a user