upgrade supabase auth to recommended
This commit is contained in:
15
pages/confirm.vue
Normal file
15
pages/confirm.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
const user = useSupabaseUser();
|
||||
watch(
|
||||
user,
|
||||
() => {
|
||||
if (user.value) {
|
||||
return navigateTo('/dashboard');
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<div>Logging you in...</div>
|
||||
</template>
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
const supabase = useSupabaseAuthClient();
|
||||
const supabase = useSupabaseClient();
|
||||
const config = useRuntimeConfig();
|
||||
const notifyStore = useNotifyStore();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
const supabase = useSupabaseAuthClient();
|
||||
const supabase = useSupabaseClient();
|
||||
|
||||
const notifyStore = useNotifyStore();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
const user = useSupabaseUser();
|
||||
const supabase = useSupabaseAuthClient();
|
||||
const supabase = useSupabaseClient();
|
||||
|
||||
const accountStore = useAccountStore();
|
||||
const notifyStore = useNotifyStore();
|
||||
@@ -8,6 +8,7 @@
|
||||
const loading = ref(false);
|
||||
const email = ref('');
|
||||
const password = ref('');
|
||||
const config = useRuntimeConfig();
|
||||
|
||||
const handleStandardSignin = async () => {
|
||||
console.log(
|
||||
@@ -32,7 +33,10 @@
|
||||
try {
|
||||
loading.value = true;
|
||||
const { error } = await supabase.auth.signInWithOAuth({
|
||||
provider: 'google'
|
||||
provider: 'google',
|
||||
options: {
|
||||
redirectTo: `${config.public.siteRootUrl}/confirm`
|
||||
}
|
||||
});
|
||||
if (error) throw error;
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
const user = useSupabaseUser();
|
||||
const supabase = useSupabaseAuthClient();
|
||||
const supabase = useSupabaseClient();
|
||||
|
||||
const notifyStore = useNotifyStore();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user