Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tiny-singers-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@react-oauth/google': minor
---

Added natively supported state property to GoogleLogin component
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ const hasAccess = hasGrantedAnyScopeGoogle(
| | native_callback | `(response: { id: string; password: string }) => void` | The JavaScript password credential handler function name |
| | prompt_parent_id | `string` | The DOM ID of the One Tap prompt container element |
| | nonce | `string` | A random string for ID tokens |
| | state | `string` | This string returns with the ID token |
| | context | `signin` \| `signup` \| `use` | The title and words in the One Tap prompt |
| | state_cookie_domain | `string` | If you need to call One Tap in the parent domain and its subdomains, pass the parent domain to this attribute so that a single shared cookie is used |
| | allowed_parent_origin | `string` \| `string[]` | The origins that are allowed to embed the intermediate iframe. One Tap will run in the intermediate iframe mode if this attribute presents |
Expand Down
2 changes: 2 additions & 0 deletions packages/@react-oauth/google/src/GoogleLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default function GoogleLogin({
width,
locale,
click_listener,
state,
containerProps,
...props
}: GoogleLoginProps) {
Expand Down Expand Up @@ -80,6 +81,7 @@ export default function GoogleLogin({
width,
locale,
click_listener,
state,
});

if (useOneTap)
Expand Down
2 changes: 2 additions & 0 deletions packages/@react-oauth/google/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ export interface GsiButtonConfiguration {
locale?: string;
/** If set, this [function](https://developers.google.com/identity/gsi/web/reference/js-reference#click_listener) will be called when the Sign in with Google button is clicked. */
click_listener?: () => void;
/** If set, this [string](https://developers.google.com/identity/gsi/web/reference/js-reference#state) returns with the ID token. */
state?: string;
}

export interface PromptMomentNotification {
Expand Down