From 4a076f1d0a2ed891caadfcda29564ce0a20bdfc2 Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Thu, 2 Mar 2023 13:35:47 +0800 Subject: [PATCH] docs: update google oauth docs (#12753) --- .../guides/auth/social-login/auth-google.mdx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/docs/pages/guides/auth/social-login/auth-google.mdx b/apps/docs/pages/guides/auth/social-login/auth-google.mdx index 261887a8468..0e9cbe5fc3d 100644 --- a/apps/docs/pages/guides/auth/social-login/auth-google.mdx +++ b/apps/docs/pages/guides/auth/social-login/auth-google.mdx @@ -83,6 +83,24 @@ async function signInWithGoogle() { } ``` +Google OAuth2.0 doesn't return the `provider_refresh_token` by default. If you need the `provider_refresh_token` returned, you will need to add additional query parameters: + +```js +async function signInWithGoogle() { + const { data, error } = await supabase.auth.signInWithOAuth({ + provider: 'google', + options: { + queryParams: { + access_type: 'offline', + prompt: 'consent', + }, + }, + }) +} +``` + +You can view the full list of query parameters and their descriptions [here](https://developers.google.com/identity/protocols/oauth2/web-server#creatingclient). + When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage: ```js