Skip to content

Commit 3826f02

Browse files
authored
feat(usegoogleonetaplogin): add state_cookie_domain to allow multiple subdomains connection (#253)
1 parent f68498c commit 3826f02

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/cuddly-peas-switch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@react-oauth/google': minor
3+
---
4+
5+
add state_cookie_domain to allow multiple subdomains connection

packages/@react-oauth/google/src/hooks/useGoogleOneTapLogin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface UseGoogleOneTapLoginOptions {
1414
promptMomentNotification?: MomentListener;
1515
cancel_on_tap_outside?: boolean;
1616
prompt_parent_id?: string;
17+
state_cookie_domain?: string;
1718
hosted_domain?: string;
1819
disabled?: boolean;
1920
}
@@ -24,6 +25,7 @@ export default function useGoogleOneTapLogin({
2425
promptMomentNotification,
2526
cancel_on_tap_outside,
2627
prompt_parent_id,
28+
state_cookie_domain,
2729
hosted_domain,
2830
disabled,
2931
}: UseGoogleOneTapLoginOptions): void {
@@ -63,6 +65,7 @@ export default function useGoogleOneTapLogin({
6365
hosted_domain,
6466
cancel_on_tap_outside,
6567
prompt_parent_id,
68+
state_cookie_domain,
6669
});
6770

6871
window?.google?.accounts?.id?.prompt(promptMomentNotificationRef.current);
@@ -75,6 +78,7 @@ export default function useGoogleOneTapLogin({
7578
scriptLoadedSuccessfully,
7679
cancel_on_tap_outside,
7780
prompt_parent_id,
81+
state_cookie_domain,
7882
hosted_domain,
7983
disabled,
8084
]);

0 commit comments

Comments
 (0)