@terminal3/t3n-sdk 3.10.0 → 3.10.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/README.md +12 -0
- package/dist/index.d.ts +28 -4
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -156,6 +156,18 @@ try {
|
|
|
156
156
|
For tests that "just want it to work", `runOtpThenUserInput` chains the three
|
|
157
157
|
calls behind a single `getOtpCode` callback.
|
|
158
158
|
|
|
159
|
+
### Email-OTP login: skip the user-layer OTP
|
|
160
|
+
|
|
161
|
+
The example above is for a **wallet / OIDC** session proving an email for the
|
|
162
|
+
first time. If the session instead logged in via email-OTP
|
|
163
|
+
(`authenticate(createEmailOtpAuthInput(...))`), the node already proved that
|
|
164
|
+
email during login and sent the only OTP code. For that email,
|
|
165
|
+
`submitUserInput` passes the verified-email gate on the session authenticator
|
|
166
|
+
alone and the node auto-stamps `verified_contacts.email` — so call it directly,
|
|
167
|
+
with **no** `otpRequest` / `otpVerify` in between (those would send a redundant
|
|
168
|
+
second OTP email). Use the user-layer OTP only to verify a contact the session
|
|
169
|
+
has not already proven — a phone, or an email on a wallet/OIDC session.
|
|
170
|
+
|
|
159
171
|
## License
|
|
160
172
|
|
|
161
173
|
MIT
|
package/dist/index.d.ts
CHANGED
|
@@ -1840,6 +1840,14 @@ declare class T3nClient {
|
|
|
1840
1840
|
* when the node is configured with `skip_otp = true`). The next
|
|
1841
1841
|
* step is {@link otpVerify} with the code the user typed.
|
|
1842
1842
|
*
|
|
1843
|
+
* Do NOT call this to re-verify the email a session already
|
|
1844
|
+
* authenticated with via email-OTP: that email is
|
|
1845
|
+
* already proven by the login authenticator, so this call only
|
|
1846
|
+
* dispatches a redundant SECOND OTP email. For an email-OTP login,
|
|
1847
|
+
* go straight to {@link submitUserInput}. Use `otpRequest` to
|
|
1848
|
+
* verify a contact the session has NOT already proven — a phone, or
|
|
1849
|
+
* an email on a wallet/OIDC session.
|
|
1850
|
+
*
|
|
1843
1851
|
* Behaviour notes:
|
|
1844
1852
|
*
|
|
1845
1853
|
* - Contact is a discriminated object: `emailChannel` or
|
|
@@ -1923,10 +1931,18 @@ declare class T3nClient {
|
|
|
1923
1931
|
* verified email — either because {@link otpVerify} bound one or
|
|
1924
1932
|
* because the session carries a proving authenticator (OIDC /
|
|
1925
1933
|
* Email auth). Calls without proof are rejected with
|
|
1926
|
-
* {@link UserUpsertError} `kind = "EmailNotVerified"`.
|
|
1927
|
-
*
|
|
1928
|
-
*
|
|
1929
|
-
*
|
|
1934
|
+
* {@link UserUpsertError} `kind = "EmailNotVerified"`.
|
|
1935
|
+
*
|
|
1936
|
+
* Two recommended flows depending on how the session logged in:
|
|
1937
|
+
* - **Email-OTP login** ({@link createEmailOtpAuthInput}): the
|
|
1938
|
+
* login already proved the email (and sent the only OTP email),
|
|
1939
|
+
* so call `submitUserInput` DIRECTLY — the gate passes on the
|
|
1940
|
+
* session authenticator and `verified_contacts.email` is
|
|
1941
|
+
* auto-stamped. Do NOT call {@link otpRequest} first; that sends
|
|
1942
|
+
* a redundant second OTP email.
|
|
1943
|
+
* - **Wallet / OIDC login** (no proven email yet): "request OTP ->
|
|
1944
|
+
* verify OTP -> submit user input" (or use
|
|
1945
|
+
* {@link runOtpThenUserInput} which chains all three).
|
|
1930
1946
|
*
|
|
1931
1947
|
* The KYC webhook orphan-attestation flow stays here: when
|
|
1932
1948
|
* `requireExistingUser` is set, the contract identifies the user
|
|
@@ -1956,6 +1972,14 @@ declare class T3nClient {
|
|
|
1956
1972
|
* {@link otpRequest}, {@link otpVerify}, and
|
|
1957
1973
|
* {@link submitUserInput} explicitly so the application owns the
|
|
1958
1974
|
* flow.
|
|
1975
|
+
*
|
|
1976
|
+
* Do NOT use this for the email a session authenticated with via
|
|
1977
|
+
* email-OTP login: it always runs {@link otpRequest},
|
|
1978
|
+
* which dispatches a redundant second OTP email for an
|
|
1979
|
+
* already-proven email. For an email-OTP login, call
|
|
1980
|
+
* {@link submitUserInput} directly. This helper is for sessions
|
|
1981
|
+
* that still need to prove the contact (phone, or an email on a
|
|
1982
|
+
* wallet/OIDC session).
|
|
1959
1983
|
*/
|
|
1960
1984
|
runOtpThenUserInput(args: {
|
|
1961
1985
|
channel: OtpChannel;
|