Skip to content

Commit

Permalink
docs: add custom nonce (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
vonovak authored Nov 3, 2024
1 parent d764ed2 commit 34e4fc8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions docs/api/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Learn more about additional web-only parameters at [Google's reference documenta

| Name | Type | Description |
| ------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `nonce`? | `string` | Currently supported only on the Android and Web. A cryptographically random value used to mitigate replay attacks. |
| `nonce`? | `string` | A cryptographically random value used to mitigate replay attacks. Supported on all platforms. |
| `skipPrompt`? | `boolean` | Web only. When calling any of the sign-in methods, a prompt is displayed by default on the top-right of the web page. Set this to true to only allow signing in via the `WebGoogleSigninButton`. **Default** `false` |

---
Expand Down Expand Up @@ -256,13 +256,14 @@ On the Web, the signatures of `signIn`, `presentExplicitSignIn`, and `createAcco

### SignInParams

> **SignInParams**: \{`loginHint`: `string`; \}
> **SignInParams**: \{`loginHint`: `string`;`nonce`: `string`; \}
#### Type declaration

| Name | Type | Description |
| ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `loginHint`? | `string` | iOS only. The user's ID, or email address, to be prefilled in the authentication UI if possible. [See docs here](https://developers.google.com/identity/sign-in/ios/reference/Classes/GIDSignIn#-signinwithpresentingviewcontroller:hint:completion:). |
| `nonce`? | `string` | iOS only. A cryptographically random value used to mitigate replay attacks. Currently only available for sponsors. For support across all platforms, use the One-Tap sign in module. |

---

Expand Down
4 changes: 2 additions & 2 deletions docs/one-tap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Returns a `Promise` that resolves with [`OneTapResponse`](api#onetapresponse) or

```ts
await GoogleOneTapSignIn.createAccount({
nonce: 'your_nonce',
nonce: 'your_nonce', // nonce is supported on all platforms!
});
```

Expand Down Expand Up @@ -223,7 +223,7 @@ Preferably, call this method only as a reaction to when user taps a "sign in wit

```ts
await GoogleOneTapSignIn.presentExplicitSignIn({
nonce: 'your_nonce',
nonce: 'your_nonce', // nonce is supported on all platforms!
});
```

Expand Down

0 comments on commit 34e4fc8

Please sign in to comment.