@turnkey/sdk-react 5.5.8 → 6.0.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/CHANGELOG.md +64 -2
- package/dist/components/auth/Auth.d.ts.map +1 -1
- package/dist/components/auth/Auth.js +5 -2
- package/dist/components/auth/Auth.js.map +1 -1
- package/dist/components/auth/Auth.mjs +29 -23
- package/dist/components/auth/Auth.mjs.map +1 -1
- package/dist/components/auth/OtpVerification.d.ts +1 -0
- package/dist/components/auth/OtpVerification.d.ts.map +1 -1
- package/dist/components/auth/OtpVerification.js +21 -1
- package/dist/components/auth/OtpVerification.js.map +1 -1
- package/dist/components/auth/OtpVerification.mjs +49 -26
- package/dist/components/auth/OtpVerification.mjs.map +1 -1
- package/dist/components/auth/utils.d.ts +9 -0
- package/dist/components/auth/utils.d.ts.map +1 -1
- package/dist/components/auth/utils.js +38 -0
- package/dist/components/auth/utils.js.map +1 -1
- package/dist/components/auth/utils.mjs +40 -1
- package/dist/components/auth/utils.mjs.map +1 -1
- package/package.json +11 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,77 @@
|
|
|
1
1
|
# @turnkey/sdk-react
|
|
2
2
|
|
|
3
|
+
## 6.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1300](https://github.com/tkhq/sdk/pull/1300) [`1ae07ec`](https://github.com/tkhq/sdk/commit/1ae07ecbfa97e653fdb8742ada154d45d8459eab) Author [@ethankonk](https://github.com/ethankonk) - Bumped next dependency to next@15.5.18
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`bf2c28f`](https://github.com/tkhq/sdk/commit/bf2c28fec690ec31254125405bf15a482139109b), [`f505818`](https://github.com/tkhq/sdk/commit/f505818e121c137d290156a32918a884ba80e5f5), [`ad044cd`](https://github.com/tkhq/sdk/commit/ad044cdcd41690c6479a81c56ebcd6d5108581fb)]:
|
|
10
|
+
- @turnkey/sdk-types@1.1.0
|
|
11
|
+
- @turnkey/sdk-browser@6.1.0
|
|
12
|
+
- @turnkey/sdk-server@6.1.0
|
|
13
|
+
- @turnkey/crypto@2.10.0
|
|
14
|
+
- @turnkey/wallet-stamper@1.1.18
|
|
15
|
+
|
|
16
|
+
## 6.0.0
|
|
17
|
+
|
|
18
|
+
### Major Changes
|
|
19
|
+
|
|
20
|
+
- [#1250](https://github.com/tkhq/sdk/pull/1250) [`654fadc`](https://github.com/tkhq/sdk/commit/654fadc7b8296b7af7e5a68dee9ee6de20eef4c1) Author [@moeodeh3](https://github.com/moeodeh3) - ### `OtpVerification`
|
|
21
|
+
|
|
22
|
+
**What changed:** New required prop `otpEncryptionTargetBundle`
|
|
23
|
+
|
|
24
|
+
`otpEncryptionTargetBundle` comes from the `sendOtp` response:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
const { otpId, otpEncryptionTargetBundle } = await server.sendOtp({
|
|
28
|
+
appName: "Example App",
|
|
29
|
+
otpType: OtpType.Sms,
|
|
30
|
+
contact: phoneInput,
|
|
31
|
+
customSmsMessage: "Your OTP is {{.OtpCode}}",
|
|
32
|
+
userIdentifier: publicKey,
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
// before
|
|
38
|
+
<OtpVerification
|
|
39
|
+
type={type}
|
|
40
|
+
contact={contact}
|
|
41
|
+
otpId={otpId}
|
|
42
|
+
// ...
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
// after
|
|
46
|
+
<OtpVerification
|
|
47
|
+
type={type}
|
|
48
|
+
contact={contact}
|
|
49
|
+
otpId={otpId}
|
|
50
|
+
otpEncryptionTargetBundle={otpEncryptionTargetBundle} // new
|
|
51
|
+
// ...
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- Updated dependencies [[`d677115`](https://github.com/tkhq/sdk/commit/d677115e60aaee53319131723541211457803317), [`34522d4`](https://github.com/tkhq/sdk/commit/34522d447592138a82d34cd690091315f9748edb), [`f39e11e`](https://github.com/tkhq/sdk/commit/f39e11eb4dc6dde19516c3f28263528e424672f1), [`654fadc`](https://github.com/tkhq/sdk/commit/654fadc7b8296b7af7e5a68dee9ee6de20eef4c1), [`7a36539`](https://github.com/tkhq/sdk/commit/7a36539196856a8bd4ca4c54115fa9874ccc83fa), [`f39e11e`](https://github.com/tkhq/sdk/commit/f39e11eb4dc6dde19516c3f28263528e424672f1), [`34522d4`](https://github.com/tkhq/sdk/commit/34522d447592138a82d34cd690091315f9748edb), [`47c0ca4`](https://github.com/tkhq/sdk/commit/47c0ca4696c8a518f95550c35cfe4cb4985a2633), [`5624d54`](https://github.com/tkhq/sdk/commit/5624d5417d2cc30032ca4ce71da0a5c7ab9a462d), [`6128132`](https://github.com/tkhq/sdk/commit/6128132d910f658cdf83ecc1dec6598eb20c008a), [`7b80b1e`](https://github.com/tkhq/sdk/commit/7b80b1e9755b83988b5e49c34dff13dd92d9932f)]:
|
|
58
|
+
- @turnkey/crypto@2.9.0
|
|
59
|
+
- @turnkey/sdk-types@1.0.0
|
|
60
|
+
- @turnkey/sdk-server@6.0.0
|
|
61
|
+
- @turnkey/sdk-browser@6.0.0
|
|
62
|
+
- @turnkey/wallet-stamper@1.1.17
|
|
63
|
+
|
|
3
64
|
## 5.5.8
|
|
4
65
|
|
|
5
66
|
### Patch Changes
|
|
6
67
|
|
|
7
|
-
- Updated dependencies [[`d05bd86`](https://github.com/tkhq/sdk/commit/d05bd86400d463c8f8c9788e69f0918db45662b5), [`8209887`](https://github.com/tkhq/sdk/commit/8209887d48bae7ea617645603a156aeb1cfbd2e7)]:
|
|
68
|
+
- Updated dependencies [[`d05bd86`](https://github.com/tkhq/sdk/commit/d05bd86400d463c8f8c9788e69f0918db45662b5), [`ef66673`](https://github.com/tkhq/sdk/commit/ef6667325d210c8aa0ea4c1d11d834ff28ddb66c), [`8209887`](https://github.com/tkhq/sdk/commit/8209887d48bae7ea617645603a156aeb1cfbd2e7), [`547566b`](https://github.com/tkhq/sdk/commit/547566be393b6c29ca8065664a1890389f1c9580)]:
|
|
8
69
|
- @turnkey/sdk-server@5.3.0
|
|
70
|
+
- @turnkey/sdk-browser@5.16.1
|
|
9
71
|
- @turnkey/sdk-types@0.14.0
|
|
10
72
|
- @turnkey/crypto@2.8.14
|
|
11
|
-
- @turnkey/sdk-browser@5.16.1
|
|
12
73
|
- @turnkey/wallet-stamper@1.1.16
|
|
74
|
+
- next@15.5.15
|
|
13
75
|
|
|
14
76
|
## 5.5.7
|
|
15
77
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Auth.d.ts","sourceRoot":"","sources":["../../../src/components/auth/Auth.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAenD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI3E,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAoCD,UAAU,SAAS;IACjB,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,UAAU,EAAE;QACV,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,YAAY,EAAE,OAAO,CAAC;QACtB,cAAc,EAAE,OAAO,CAAC;QACxB,YAAY,EAAE,OAAO,CAAC;QACtB,YAAY,EAAE,OAAO,CAAC;QACtB,eAAe,EAAE,OAAO,CAAC;QACzB,aAAa,EAAE,OAAO,CAAC;QACvB,aAAa,EAAE,OAAO,C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QACpB,YAAY,EAAE,OAAO,CAAC;QACtB,cAAc,EAAE,OAAO,CAAC;QACxB,YAAY,EAAE,OAAO,CAAC;QACtB,YAAY,EAAE,OAAO,CAAC;QACtB,eAAe,EAAE,OAAO,CAAC;QACzB,aAAa,EAAE,OAAO,CAAC;QACvB,aAAa,EAAE,OAAO,CAAC;QACvB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,kBAAkB,CAAC,EAAE,eAAe,CAAC,4BAA4B,CAAC,CAAC;IACnE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;;GAGG;AACH,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAsuB7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -83,6 +83,7 @@ const Auth = ({
|
|
|
83
83
|
const [email, setEmail] = React.useState("");
|
|
84
84
|
const [phone, setPhone] = React.useState("");
|
|
85
85
|
const [otpId, setOtpId] = React.useState(null);
|
|
86
|
+
const [otpEncryptionTargetBundle, setOtpEncryptionTargetBundle] = React.useState(null);
|
|
86
87
|
const [step, setStep] = React.useState("auth");
|
|
87
88
|
const [loading, setLoading] = React.useState();
|
|
88
89
|
const [oauthLoading, setOauthLoading] = React.useState("");
|
|
@@ -160,7 +161,7 @@ const Auth = ({
|
|
|
160
161
|
attestation
|
|
161
162
|
},
|
|
162
163
|
...(customAccounts && {
|
|
163
|
-
customAccounts
|
|
164
|
+
customAccounts: customAccounts
|
|
164
165
|
})
|
|
165
166
|
});
|
|
166
167
|
if (response?.subOrganizationId) {
|
|
@@ -224,7 +225,8 @@ const Auth = ({
|
|
|
224
225
|
userIdentifier: publicKey
|
|
225
226
|
});
|
|
226
227
|
if (initAuthResponse && initAuthResponse.otpId) {
|
|
227
|
-
setOtpId(initAuthResponse
|
|
228
|
+
setOtpId(initAuthResponse.otpId);
|
|
229
|
+
setOtpEncryptionTargetBundle(initAuthResponse.otpEncryptionTargetBundle);
|
|
228
230
|
setStep(otpType);
|
|
229
231
|
} else {
|
|
230
232
|
onError(constants.authErrors.otp.sendFailed);
|
|
@@ -634,6 +636,7 @@ const Auth = ({
|
|
|
634
636
|
type: step,
|
|
635
637
|
contact: step === constants.OtpType.Email ? email : phone,
|
|
636
638
|
otpId: otpId,
|
|
639
|
+
otpEncryptionTargetBundle: otpEncryptionTargetBundle,
|
|
637
640
|
alphanumeric: otpConfig?.alphanumeric,
|
|
638
641
|
includeUnverifiedSubOrgs: otpConfig?.includeUnverifiedSubOrgs,
|
|
639
642
|
sessionLengthSeconds: authConfig.sessionLengthSeconds,
|