Skip to content

Commit 62aa33c

Browse files
zetlen-dandyzetlen
authored andcommitted
fix(GoogleLogin): guarantee credential presence onSuccess
1 parent 498cf95 commit 62aa33c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/violet-flowers-sell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@react-oauth/google': patch
3+
---
4+
5+
Make `credential` property guaranteed in `onSuccess` callback

packages/@react-oauth/google/src/GoogleLogin.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ import {
1212

1313
const containerHeightMap = { large: 40, medium: 32, small: 20 };
1414

15+
type SuccessfulCredentialResponse = Omit<CredentialResponse, 'credential'> & {
16+
credential: string;
17+
};
18+
1519
export type GoogleLoginProps = {
16-
onSuccess: (credentialResponse: CredentialResponse) => void;
20+
onSuccess: (credentialResponse: SuccessfulCredentialResponse) => void;
1721
onError?: () => void;
1822
promptMomentNotification?: MomentListener;
1923
useOneTap?: boolean;

0 commit comments

Comments
 (0)