2

I'm trying to test out my Nuxt app with Facebook login but I keep getting an error on the address bar:

?error=server_error&error_description=Error+getting+user+email+from+external+provider#_=_

No other errors on the console. I got all set up: Facebook app, Facebook advanced access on email and public_profile, callback URLs, app ID, and keys. It would go through Facebook's auth page then it redirects to my localhost with the error. User won't be registered to auth.users as well.

const supabase = useSupabaseAuthClient();
const socialAuth = async (provider) => {
  const { error } = await supabase.auth.signInWithOAuth({ provider: provider });
  if (error) {
    console.log(error);
  } else {
    console.log("Social Auth success.");
  }
};
<template>
  <div>
    <button @click="socialAuth('facebook')">Login with Facebook</button>
  </div>
</template>

I've tried posting this in their GitHub discussions but I haven't received an answer from the community so far.

Larra
  • 346
  • 4
  • 14
  • Are you able to run it after passing scopes? `socialAuth('facebook', 'public_profile email')`, then add scopes to the function calling the signInWithOAuth method? – Mansueli Jan 18 '23 at 18:05
  • @Mansueli I tried this. The error was gone but I still can't log in with Facebook. URL has `#_=_` on the end though. I checked the logs on Supabase and still the same error `unable to find email with Facebook provider`. – Larra Jan 20 '23 at 07:16
  • I am getting the same issue. Even when passing the scopes to the function call the seem to be ignored. – Thomas Valadez Mar 09 '23 at 18:00
  • @ThomasValadez I raised this [issue](https://github.com/supabase/gotrue/issues/936#issuecomment-1434148654) and their only response is that it's a Facebook issue. Since Supabase Auth heavily relies on having a user email, I have no workaround for this but to use another provider. – Larra Mar 10 '23 at 03:49

0 Answers0