Files
afrobiz/pages/login.vue
2023-01-02 17:04:04 +11:00

22 lines
572 B
Vue

<script setup lang="ts">
definePageMeta({
middleware: ['auth'],
});
const supabase = useSupabaseAuthClient();
async function signInWithGoogle() {
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'google',
})
navigateTo('dashboard'); // This doesn't work, it navigates prior to the login handshake completing and then the handshake lands on the index page and ignores the middleware.
}
</script>
<template>
<div>
Login
<button @click="signInWithGoogle()">Sign In with Google</button>
</div>
</template>