Scopes with Google sign in not working #885
-
I'm trying to use Google sign in with Supabase with scopes. The end goal is to be able to access the YouTube Analytics data for a signed in user. However, I'm running into 3 issues. If these are bugs, I'll open an issue for each item.
All help would be appreciated. For reference, here's the code. From what I can tell, it follows the example in the docs. const { user, session, error } = await supabase.auth.signIn(
{
provider: 'google',
},
{
scopes:
'https://www.googleapis.com/auth/youtube.readonly https://www.googleapis.com/auth/yt-analytics-monetary.readonly',
redirectTo: `https://example.com/dashboard`,
}
) The YT scopes are defined here. Scopes are not workingWhen running the above code, the user is not prompted for also allow permissions for the YouTube APIs. I can confirm that are not added by looking at the authorized apps in my Google account. As you can see, only basic information like email is authorized. TypeScript throws errorsEssentially, TypeScript does not think that the scopes are an allowed option. And I'm fairly sure I used the correct format as per the docs—I just copy-pasted the docs code. Any ideas how to resolve/debug these issues? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solved. You need to use |
Beta Was this translation helpful? Give feedback.
Solved.
You need to use
@supabase/supabase-js
v1.6.0 or later.