Sign in with microsoft now works but sign out when signed in via microsoft does not

This commit is contained in:
2025-06-06 16:35:28 -05:00
parent 35e019558f
commit 930dc0867d
6 changed files with 43 additions and 81 deletions

View File

@ -60,10 +60,12 @@ export const signIn = async (formData: FormData): Promise<Result<null>> => {
export const signInWithMicrosoft = async (): Promise<Result<string>> => {
const supabase = await createServerClient();
const origin = (await headers()).get('origin');
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'azure',
options: {
scopes: 'openid, profile email offline_access',
redirectTo: `${origin}/auth/callback?redirect_to=/auth/success`,
},
});
if (error) return { success: false, error: error.message };
@ -72,10 +74,12 @@ export const signInWithMicrosoft = async (): Promise<Result<string>> => {
export const signInWithApple = async (): Promise<Result<string>> => {
const supabase = await createServerClient();
const origin = process.env.BASE_URL!;
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'apple',
options: {
scopes: 'openid, profile email offline_access',
redirectTo: `${origin}/auth/callback?redirect_to=/auth/success`,
},
});
if (error) return { success: false, error: error.message };