@erikey/react 0.4.28 → 0.4.30
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.mts +140 -6
- package/dist/index.mjs +15 -3
- package/dist/index.mjs.map +1 -1
- package/dist/ui/index.mjs +5 -1
- package/dist/ui/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/auth-client.ts +3 -3
- package/src/kv-client.ts +2 -2
- package/src/ui/components/auth/forms/sign-up-form.tsx +6 -1
package/package.json
CHANGED
package/src/auth-client.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { createAuthClient as createBetterAuthClient } from 'better-auth/react';
|
|
16
|
-
import { siweClient } from 'better-auth/client/plugins';
|
|
16
|
+
import { siweClient, emailOTPClient } from 'better-auth/client/plugins';
|
|
17
17
|
import {
|
|
18
18
|
shouldUseBearerAuth,
|
|
19
19
|
storeToken,
|
|
@@ -145,8 +145,8 @@ export function createAuthClient(config: AuthClientConfig) {
|
|
|
145
145
|
fetchOptions,
|
|
146
146
|
// For same-origin, include cookies (cross-origin uses Bearer from fetchOptions.auth)
|
|
147
147
|
...(!useBearerAuth && { credentials: 'include' as const }),
|
|
148
|
-
// Enable SIWE (Sign-In with Ethereum) support
|
|
149
|
-
plugins: [siweClient()],
|
|
148
|
+
// Enable SIWE (Sign-In with Ethereum) and email OTP support
|
|
149
|
+
plugins: [siweClient(), emailOTPClient()],
|
|
150
150
|
});
|
|
151
151
|
|
|
152
152
|
return client;
|
package/src/kv-client.ts
CHANGED
|
@@ -55,7 +55,7 @@ export interface GetValueResponse {
|
|
|
55
55
|
|
|
56
56
|
export interface GetValuesResponse {
|
|
57
57
|
success: boolean;
|
|
58
|
-
data?: {
|
|
58
|
+
data?: { items: KvPair[]; total: number };
|
|
59
59
|
error?: string;
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -202,7 +202,7 @@ export function createKvClient(config: KvClientConfig) {
|
|
|
202
202
|
return {
|
|
203
203
|
success: true,
|
|
204
204
|
data: {
|
|
205
|
-
|
|
205
|
+
items: result.data.items,
|
|
206
206
|
total: result.data.total,
|
|
207
207
|
},
|
|
208
208
|
};
|
|
@@ -384,7 +384,12 @@ export function SignUpForm({
|
|
|
384
384
|
fetchOptions
|
|
385
385
|
})
|
|
386
386
|
|
|
387
|
-
|
|
387
|
+
// Check for 2FA redirect first (same pattern as sign-in form)
|
|
388
|
+
if ((data as { twoFactorRedirect?: boolean }).twoFactorRedirect) {
|
|
389
|
+
navigate(
|
|
390
|
+
`${basePath}/${viewPaths.TWO_FACTOR}${window.location.search}`
|
|
391
|
+
)
|
|
392
|
+
} else if ("token" in data && data.token) {
|
|
388
393
|
await onSuccess()
|
|
389
394
|
} else if (emailVerification?.otp) {
|
|
390
395
|
navigate(
|