Skip to content

Commit 41c408c

Browse files
rutvik24mikehardy
andauthored
docs(auth): add Credential Manager Google Sign-In support and safety guards (#9037)
* docs(auth): document free Credential Manager Google Sign-In via react-native * docs(auth): guard currentUser before linkWithCredential in Google examples * docs(auth): correct links for react-native-nitro-google-sign-in documentation * use optional chaining to guard against result.data possibly being undefined --------- Co-authored-by: Mike Hardy <github@mikehardy.net>
1 parent a61bbab commit 41c408c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/auth/social-auth.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Install the package and its peer dependency:
229229
yarn add react-native-nitro-google-signin react-native-nitro-modules
230230
```
231231

232-
Then follow the [installation](https://react-native-nitro-google-signin.github.io/docs/getting-started/installation) and [Google Cloud setup](https://react-native-nitro-google-signin.github.io/docs/setup/google-cloud) guides. For Expo, use a [development build](https://docs.expo.dev/develop/development-builds/introduction/) and the [Expo config plugin](https://react-native-nitro-google-signin.github.io/docs/setup/expo) — it does not run in Expo Go.
232+
Then follow the [installation](https://react-native-nitro-google-sign-in.github.io/docs/getting-started/installation) and [Google Cloud setup](https://react-native-nitro-google-sign-in.github.io/docs/setup/google-cloud) guides. For Expo, use a [development build](https://docs.expo.dev/develop/development-builds/introduction/) and the [Expo config plugin](https://react-native-nitro-google-sign-in.github.io/docs/setup/expo) — it does not run in Expo Go.
233233

234234
#### Using Google Sign-In with Firebase
235235

@@ -280,7 +280,7 @@ async function onGoogleButtonPress() {
280280
throw new Error('Google Sign-In was cancelled or failed');
281281
}
282282

283-
const { idToken } = response.data;
283+
const idToken = response.data?.idToken;
284284
if (!idToken) {
285285
throw new Error('No ID token found');
286286
}
@@ -294,7 +294,7 @@ Upon successful sign-in, any [`onAuthStateChanged`](/auth/usage#listening-to-aut
294294
295295
If you test on an Android emulator, use an image with **Google APIs** or **Google Play** system images.
296296
297-
Full API details: [react-native-nitro-google-signin documentation](https://react-native-nitro-google-signin.github.io/).
297+
Full API details: [react-native-nitro-google-signin documentation](https://react-native-nitro-google-sign-in.github.io/).
298298
299299
### @react-native-google-signin/google-signin
300300
@@ -517,7 +517,7 @@ async function onGoogleLinkButtonPress() {
517517
if (isNoSavedCredentialFoundResponse(response)) {
518518
response = await GoogleOneTapSignIn.presentExplicitSignIn();
519519
}
520-
if (!isSuccessResponse(response) || !response.data.idToken) {
520+
if (!isSuccessResponse(response) || !response.data?.idToken) {
521521
throw new Error('Google Sign-In failed');
522522
}
523523

0 commit comments

Comments
 (0)