Add prompt and include_granted_scopes to Google OAuth params (#730)

<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Add `prompt` and `include_granted_scopes` to Google OAuth params in
`GoogleProvider`.
> 
>   - **Behavior**:
> - Adds `prompt: "consent"` and `include_granted_scopes: "true"` to
`authorizationExtraParams` in `GoogleProvider` in `google.tsx`.
> - Ensures user consent is always prompted and previously granted
scopes are included in Google OAuth flow.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for e2d3d9ca60. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->

Co-authored-by: Zai Shi <zaishi00@outlook.com>
This commit is contained in:
Kyle Worrall 2025-07-02 12:12:23 -07:00 committed by GitHub
parent 85b24fb37f
commit d140c4226f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,6 +22,10 @@ export class GoogleProvider extends OAuthBaseProvider {
openid: true,
jwksUri: "https://www.googleapis.com/oauth2/v3/certs",
baseScope: "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile",
authorizationExtraParams: {
prompt: "consent",
include_granted_scopes: "true",
},
...options,
}));
}