I’m trying to configure my app to redirect to the address: http://localhost:3000/home
when the user successfully logs in. I’m using Oauth through Azure to perform authentication. The problem is that the user is not redirected, and remains on /login
page. Supabase Azure Oauth callback URL is configured correctly in Azure Panel.
Supabase config:
st_main.js
(Pinia Store):
import { defineStore } from "pinia";
export const st_main = defineStore("st_main", () => {
const supabase = useSupabaseClient();
async function signInWithAzure() {
const {data} = await supabase.auth.signInWithOAuth({
provider: "azure",
options: {
scopes: "email"
},
})
}
async function signOut() {
const { error } = await supabase.auth.signOut()
}
return {
supabase,
signInWithAzure,
signOut,
}
})
login.vue
(Login page):
<template>
<q-layout view="hHh lpR fFf">
<q-page-container>
<div class="q-pa-md q-gutter-sm">
<q-btn color="primary" icon="login" label="LogIn with Azure" @click="stMain.signInWithAzure()" />
<q-btn color="primary" icon="logout" label="LogOut" @click="stMain.signOut()" />
</div>
</q-page-container>
</q-layout>
</template>
<script setup>
import { st_main } from '@/stores/st_main'
const stMain = st_main()
</script>
Am I doing something wrong?
What could be happening?
I’ve already tried applying the redirectTo
parameter in the options, but failed.
Will.Marcondes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.