@opensecret/react 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -129,6 +129,7 @@ declare type AppleAuthResponse = {
|
|
|
129
129
|
* @property email - Optional email address (only provided on first sign-in)
|
|
130
130
|
* @property given_name - Optional user's first name (only provided on first sign-in)
|
|
131
131
|
* @property family_name - Optional user's last name (only provided on first sign-in)
|
|
132
|
+
* @property nonce - Optional nonce for preventing replay attacks
|
|
132
133
|
*/
|
|
133
134
|
declare type AppleUser = {
|
|
134
135
|
user_identifier: string;
|
|
@@ -136,6 +137,7 @@ declare type AppleUser = {
|
|
|
136
137
|
email?: string;
|
|
137
138
|
given_name?: string;
|
|
138
139
|
family_name?: string;
|
|
140
|
+
nonce?: string;
|
|
139
141
|
};
|
|
140
142
|
|
|
141
143
|
declare interface Attestation {
|
|
@@ -518,6 +520,11 @@ declare function handleAppleCallback(code: string, state: string, inviteCode: st
|
|
|
518
520
|
*
|
|
519
521
|
* Note: Email and name information are only provided by Apple on the first
|
|
520
522
|
* authentication. Your backend should store this information for future use.
|
|
523
|
+
*
|
|
524
|
+
* The nonce parameter (optional) can be provided as part of the appleUser object.
|
|
525
|
+
* When using Sign in with Apple, you can generate a nonce on your client and pass
|
|
526
|
+
* it both to Apple during authentication initiation and to this function for validation.
|
|
527
|
+
* The backend will verify that the nonce in the JWT matches what was provided.
|
|
521
528
|
*/
|
|
522
529
|
declare function handleAppleNativeSignIn(appleUser: AppleUser, client_id: string, inviteCode?: string): Promise<LoginResponse>;
|
|
523
530
|
|