@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/dist/index.d.mts
CHANGED
|
@@ -1333,6 +1333,141 @@ declare function createAuthClient(config: AuthClientConfig): {
|
|
|
1333
1333
|
code?: string | undefined;
|
|
1334
1334
|
message?: string | undefined;
|
|
1335
1335
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1336
|
+
} & {
|
|
1337
|
+
emailOtp: {
|
|
1338
|
+
sendVerificationOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1339
|
+
email: string;
|
|
1340
|
+
type: "sign-in" | "email-verification" | "forget-password";
|
|
1341
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any>>>(data_0: better_auth.Prettify<{
|
|
1342
|
+
email: string;
|
|
1343
|
+
type: "sign-in" | "email-verification" | "forget-password";
|
|
1344
|
+
} & {
|
|
1345
|
+
fetchOptions?: FetchOptions;
|
|
1346
|
+
}>, data_1?: FetchOptions) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
1347
|
+
success: boolean;
|
|
1348
|
+
}, {
|
|
1349
|
+
code?: string | undefined;
|
|
1350
|
+
message?: string | undefined;
|
|
1351
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1352
|
+
};
|
|
1353
|
+
} & {
|
|
1354
|
+
emailOtp: {
|
|
1355
|
+
checkVerificationOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1356
|
+
email: string;
|
|
1357
|
+
type: "sign-in" | "email-verification" | "forget-password";
|
|
1358
|
+
otp: string;
|
|
1359
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any>>>(data_0: better_auth.Prettify<{
|
|
1360
|
+
email: string;
|
|
1361
|
+
type: "sign-in" | "email-verification" | "forget-password";
|
|
1362
|
+
otp: string;
|
|
1363
|
+
} & {
|
|
1364
|
+
fetchOptions?: FetchOptions;
|
|
1365
|
+
}>, data_1?: FetchOptions) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
1366
|
+
success: boolean;
|
|
1367
|
+
}, {
|
|
1368
|
+
code?: string | undefined;
|
|
1369
|
+
message?: string | undefined;
|
|
1370
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1371
|
+
};
|
|
1372
|
+
} & {
|
|
1373
|
+
emailOtp: {
|
|
1374
|
+
verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1375
|
+
email: string;
|
|
1376
|
+
otp: string;
|
|
1377
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any>>>(data_0: better_auth.Prettify<{
|
|
1378
|
+
email: string;
|
|
1379
|
+
otp: string;
|
|
1380
|
+
} & {
|
|
1381
|
+
fetchOptions?: FetchOptions;
|
|
1382
|
+
}>, data_1?: FetchOptions) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
|
|
1383
|
+
status: boolean;
|
|
1384
|
+
token: string;
|
|
1385
|
+
user: {
|
|
1386
|
+
id: string;
|
|
1387
|
+
email: string;
|
|
1388
|
+
emailVerified: boolean;
|
|
1389
|
+
name: string;
|
|
1390
|
+
image: string | null | undefined;
|
|
1391
|
+
createdAt: Date;
|
|
1392
|
+
updatedAt: Date;
|
|
1393
|
+
};
|
|
1394
|
+
} | {
|
|
1395
|
+
status: boolean;
|
|
1396
|
+
token: null;
|
|
1397
|
+
user: {
|
|
1398
|
+
id: string;
|
|
1399
|
+
email: string;
|
|
1400
|
+
emailVerified: boolean;
|
|
1401
|
+
name: string;
|
|
1402
|
+
image: string | null | undefined;
|
|
1403
|
+
createdAt: Date;
|
|
1404
|
+
updatedAt: Date;
|
|
1405
|
+
};
|
|
1406
|
+
}>, {
|
|
1407
|
+
code?: string | undefined;
|
|
1408
|
+
message?: string | undefined;
|
|
1409
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1410
|
+
};
|
|
1411
|
+
} & {
|
|
1412
|
+
signIn: {
|
|
1413
|
+
emailOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1414
|
+
email: string;
|
|
1415
|
+
otp: string;
|
|
1416
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any>>>(data_0: better_auth.Prettify<{
|
|
1417
|
+
email: string;
|
|
1418
|
+
otp: string;
|
|
1419
|
+
} & {
|
|
1420
|
+
fetchOptions?: FetchOptions;
|
|
1421
|
+
}>, data_1?: FetchOptions) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
1422
|
+
token: string;
|
|
1423
|
+
user: {
|
|
1424
|
+
id: string;
|
|
1425
|
+
email: string;
|
|
1426
|
+
emailVerified: boolean;
|
|
1427
|
+
name: string;
|
|
1428
|
+
image: string | null | undefined;
|
|
1429
|
+
createdAt: Date;
|
|
1430
|
+
updatedAt: Date;
|
|
1431
|
+
};
|
|
1432
|
+
}, {
|
|
1433
|
+
code?: string | undefined;
|
|
1434
|
+
message?: string | undefined;
|
|
1435
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1436
|
+
};
|
|
1437
|
+
} & {
|
|
1438
|
+
forgetPassword: {
|
|
1439
|
+
emailOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1440
|
+
email: string;
|
|
1441
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any>>>(data_0: better_auth.Prettify<{
|
|
1442
|
+
email: string;
|
|
1443
|
+
} & {
|
|
1444
|
+
fetchOptions?: FetchOptions;
|
|
1445
|
+
}>, data_1?: FetchOptions) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
1446
|
+
success: boolean;
|
|
1447
|
+
}, {
|
|
1448
|
+
code?: string | undefined;
|
|
1449
|
+
message?: string | undefined;
|
|
1450
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1451
|
+
};
|
|
1452
|
+
} & {
|
|
1453
|
+
emailOtp: {
|
|
1454
|
+
resetPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1455
|
+
email: string;
|
|
1456
|
+
otp: string;
|
|
1457
|
+
password: string;
|
|
1458
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any>>>(data_0: better_auth.Prettify<{
|
|
1459
|
+
email: string;
|
|
1460
|
+
otp: string;
|
|
1461
|
+
password: string;
|
|
1462
|
+
} & {
|
|
1463
|
+
fetchOptions?: FetchOptions;
|
|
1464
|
+
}>, data_1?: FetchOptions) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
1465
|
+
success: boolean;
|
|
1466
|
+
}, {
|
|
1467
|
+
code?: string | undefined;
|
|
1468
|
+
message?: string | undefined;
|
|
1469
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1470
|
+
};
|
|
1336
1471
|
} & {
|
|
1337
1472
|
useSession: () => {
|
|
1338
1473
|
data: {
|
|
@@ -1443,11 +1578,7 @@ declare function createAuthClient(config: AuthClientConfig): {
|
|
|
1443
1578
|
body?: any;
|
|
1444
1579
|
query?: any;
|
|
1445
1580
|
params?: any;
|
|
1446
|
-
duplex
|
|
1447
|
-
/**
|
|
1448
|
-
* Type helper for inferring the auth client type
|
|
1449
|
-
*/
|
|
1450
|
-
?: "full" | "half" | undefined;
|
|
1581
|
+
duplex?: "full" | "half" | undefined;
|
|
1451
1582
|
jsonParser: (text: string) => Promise<any> | any;
|
|
1452
1583
|
retry?: _better_fetch_fetch.RetryOptions | undefined;
|
|
1453
1584
|
retryAttempt?: number | undefined;
|
|
@@ -1462,6 +1593,9 @@ declare function createAuthClient(config: AuthClientConfig): {
|
|
|
1462
1593
|
atoms: Record<string, better_auth_react.WritableAtom<any>>;
|
|
1463
1594
|
};
|
|
1464
1595
|
$ERROR_CODES: {
|
|
1596
|
+
readonly OTP_EXPIRED: "OTP expired";
|
|
1597
|
+
readonly INVALID_OTP: "Invalid OTP";
|
|
1598
|
+
readonly TOO_MANY_ATTEMPTS: "Too many attempts";
|
|
1465
1599
|
readonly USER_NOT_FOUND: "User not found";
|
|
1466
1600
|
readonly FAILED_TO_CREATE_USER: "Failed to create user";
|
|
1467
1601
|
readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
|
|
@@ -1557,7 +1691,7 @@ interface GetValueResponse {
|
|
|
1557
1691
|
interface GetValuesResponse {
|
|
1558
1692
|
success: boolean;
|
|
1559
1693
|
data?: {
|
|
1560
|
-
|
|
1694
|
+
items: KvPair[];
|
|
1561
1695
|
total: number;
|
|
1562
1696
|
};
|
|
1563
1697
|
error?: string;
|
package/dist/index.mjs
CHANGED
|
@@ -1225,6 +1225,18 @@ var userAc = defaultAc.newRole({
|
|
|
1225
1225
|
session: []
|
|
1226
1226
|
});
|
|
1227
1227
|
|
|
1228
|
+
// ../../../node_modules/.pnpm/better-auth@1.4.10_drizzle-kit@0.31.8_drizzle-orm@0.45.1_@cloudflare+workers-types@4.20251119_hirg525kbrpwuqvxcih3czaike/node_modules/better-auth/dist/plugins/email-otp/client.mjs
|
|
1229
|
+
var emailOTPClient = () => {
|
|
1230
|
+
return {
|
|
1231
|
+
id: "email-otp",
|
|
1232
|
+
$InferServerPlugin: {},
|
|
1233
|
+
atomListeners: [{
|
|
1234
|
+
matcher: (path) => path === "/email-otp/verify-email" || path === "/sign-in/email-otp",
|
|
1235
|
+
signal: "$sessionSignal"
|
|
1236
|
+
}]
|
|
1237
|
+
};
|
|
1238
|
+
};
|
|
1239
|
+
|
|
1228
1240
|
// ../../../node_modules/.pnpm/better-auth@1.4.10_drizzle-kit@0.31.8_drizzle-orm@0.45.1_@cloudflare+workers-types@4.20251119_hirg525kbrpwuqvxcih3czaike/node_modules/better-auth/dist/plugins/organization/access/statement.mjs
|
|
1229
1241
|
var defaultStatements2 = {
|
|
1230
1242
|
organization: ["update", "delete"],
|
|
@@ -1408,8 +1420,8 @@ function createAuthClient3(config) {
|
|
|
1408
1420
|
fetchOptions,
|
|
1409
1421
|
// For same-origin, include cookies (cross-origin uses Bearer from fetchOptions.auth)
|
|
1410
1422
|
...!useBearerAuth && { credentials: "include" },
|
|
1411
|
-
// Enable SIWE (Sign-In with Ethereum) support
|
|
1412
|
-
plugins: [siweClient()]
|
|
1423
|
+
// Enable SIWE (Sign-In with Ethereum) and email OTP support
|
|
1424
|
+
plugins: [siweClient(), emailOTPClient()]
|
|
1413
1425
|
});
|
|
1414
1426
|
return client;
|
|
1415
1427
|
}
|
|
@@ -1492,7 +1504,7 @@ function createKvClient(config) {
|
|
|
1492
1504
|
return {
|
|
1493
1505
|
success: true,
|
|
1494
1506
|
data: {
|
|
1495
|
-
|
|
1507
|
+
items: result.data.items,
|
|
1496
1508
|
total: result.data.total
|
|
1497
1509
|
}
|
|
1498
1510
|
};
|