@convex-dev/better-auth 0.7.6 → 0.7.8
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/commonjs/client/index.d.ts +268 -10
- package/dist/commonjs/client/index.d.ts.map +1 -1
- package/dist/commonjs/client/index.js +9 -0
- package/dist/commonjs/client/index.js.map +1 -1
- package/dist/commonjs/component/lib.d.ts +7 -1
- package/dist/commonjs/component/lib.d.ts.map +1 -1
- package/dist/commonjs/component/lib.js.map +1 -1
- package/dist/commonjs/component/schema.d.ts +15 -5
- package/dist/commonjs/component/schema.d.ts.map +1 -1
- package/dist/commonjs/component/schema.js +5 -0
- package/dist/commonjs/component/schema.js.map +1 -1
- package/dist/commonjs/component/util.d.ts +35 -15
- package/dist/commonjs/component/util.d.ts.map +1 -1
- package/dist/commonjs/plugins/convex/index.d.ts.map +1 -1
- package/dist/commonjs/plugins/convex/index.js +1 -1
- package/dist/commonjs/plugins/convex/index.js.map +1 -1
- package/dist/esm/client/index.d.ts +268 -10
- package/dist/esm/client/index.d.ts.map +1 -1
- package/dist/esm/client/index.js +9 -0
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/component/lib.d.ts +7 -1
- package/dist/esm/component/lib.d.ts.map +1 -1
- package/dist/esm/component/lib.js.map +1 -1
- package/dist/esm/component/schema.d.ts +15 -5
- package/dist/esm/component/schema.d.ts.map +1 -1
- package/dist/esm/component/schema.js +5 -0
- package/dist/esm/component/schema.js.map +1 -1
- package/dist/esm/component/util.d.ts +35 -15
- package/dist/esm/component/util.d.ts.map +1 -1
- package/dist/esm/plugins/convex/index.d.ts.map +1 -1
- package/dist/esm/plugins/convex/index.js +1 -1
- package/dist/esm/plugins/convex/index.js.map +1 -1
- package/package.json +2 -2
- package/src/client/index.ts +17 -0
- package/src/component/_generated/api.d.ts +15 -0
- package/src/component/lib.ts +1 -1
- package/src/component/schema.ts +5 -0
- package/src/plugins/convex/index.ts +1 -1
|
@@ -51,6 +51,9 @@ export type Mounts = {
|
|
|
51
51
|
input:
|
|
52
52
|
| {
|
|
53
53
|
data: {
|
|
54
|
+
banExpires?: number;
|
|
55
|
+
banReason?: string;
|
|
56
|
+
banned?: boolean;
|
|
54
57
|
createdAt: number;
|
|
55
58
|
displayUsername?: string;
|
|
56
59
|
email: string;
|
|
@@ -60,6 +63,7 @@ export type Mounts = {
|
|
|
60
63
|
name: string;
|
|
61
64
|
phoneNumber?: string;
|
|
62
65
|
phoneNumberVerified?: boolean;
|
|
66
|
+
role?: string;
|
|
63
67
|
stripeCustomerId?: string;
|
|
64
68
|
twoFactorEnabled?: boolean;
|
|
65
69
|
updatedAt: number;
|
|
@@ -95,6 +99,7 @@ export type Mounts = {
|
|
|
95
99
|
activeOrganizationId?: string;
|
|
96
100
|
createdAt: number;
|
|
97
101
|
expiresAt: number;
|
|
102
|
+
impersonatedBy?: string;
|
|
98
103
|
ipAddress?: string;
|
|
99
104
|
token: string;
|
|
100
105
|
updatedAt: number;
|
|
@@ -849,6 +854,9 @@ export type Mounts = {
|
|
|
849
854
|
sortBy?: { direction: "asc" | "desc"; field: string };
|
|
850
855
|
unique?: boolean;
|
|
851
856
|
update: {
|
|
857
|
+
banExpires?: number;
|
|
858
|
+
banReason?: string;
|
|
859
|
+
banned?: boolean;
|
|
852
860
|
createdAt?: number;
|
|
853
861
|
displayUsername?: string;
|
|
854
862
|
email?: string;
|
|
@@ -858,6 +866,7 @@ export type Mounts = {
|
|
|
858
866
|
name?: string;
|
|
859
867
|
phoneNumber?: string;
|
|
860
868
|
phoneNumberVerified?: boolean;
|
|
869
|
+
role?: string;
|
|
861
870
|
stripeCustomerId?: string;
|
|
862
871
|
twoFactorEnabled?: boolean;
|
|
863
872
|
updatedAt?: number;
|
|
@@ -906,6 +915,7 @@ export type Mounts = {
|
|
|
906
915
|
activeOrganizationId?: string;
|
|
907
916
|
createdAt?: number;
|
|
908
917
|
expiresAt?: number;
|
|
918
|
+
impersonatedBy?: string;
|
|
909
919
|
ipAddress?: string;
|
|
910
920
|
token?: string;
|
|
911
921
|
updatedAt?: number;
|
|
@@ -1701,6 +1711,9 @@ export type Mounts = {
|
|
|
1701
1711
|
| {
|
|
1702
1712
|
model: "user";
|
|
1703
1713
|
update: {
|
|
1714
|
+
banExpires?: number;
|
|
1715
|
+
banReason?: string;
|
|
1716
|
+
banned?: boolean;
|
|
1704
1717
|
createdAt?: number;
|
|
1705
1718
|
displayUsername?: string;
|
|
1706
1719
|
email?: string;
|
|
@@ -1710,6 +1723,7 @@ export type Mounts = {
|
|
|
1710
1723
|
name?: string;
|
|
1711
1724
|
phoneNumber?: string;
|
|
1712
1725
|
phoneNumberVerified?: boolean;
|
|
1726
|
+
role?: string;
|
|
1713
1727
|
stripeCustomerId?: string;
|
|
1714
1728
|
twoFactorEnabled?: boolean;
|
|
1715
1729
|
updatedAt?: number;
|
|
@@ -1745,6 +1759,7 @@ export type Mounts = {
|
|
|
1745
1759
|
activeOrganizationId?: string;
|
|
1746
1760
|
createdAt?: number;
|
|
1747
1761
|
expiresAt?: number;
|
|
1762
|
+
impersonatedBy?: string;
|
|
1748
1763
|
ipAddress?: string;
|
|
1749
1764
|
token?: string;
|
|
1750
1765
|
updatedAt?: number;
|
package/src/component/lib.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { partial } from "convex-helpers/validators";
|
|
12
12
|
import { stream } from "convex-helpers/server/stream";
|
|
13
13
|
import { mergedStream } from "convex-helpers/server/stream";
|
|
14
|
-
import { stripIndent
|
|
14
|
+
import { stripIndent } from "common-tags";
|
|
15
15
|
|
|
16
16
|
export const adapterWhereValidator = v.object({
|
|
17
17
|
field: v.string(),
|
package/src/component/schema.ts
CHANGED
|
@@ -19,6 +19,10 @@ const schema = defineSchema({
|
|
|
19
19
|
displayUsername: v.optional(v.string()),
|
|
20
20
|
phoneNumber: v.optional(v.string()),
|
|
21
21
|
phoneNumberVerified: v.optional(v.boolean()),
|
|
22
|
+
role: v.optional(v.string()),
|
|
23
|
+
banned: v.optional(v.boolean()),
|
|
24
|
+
banReason: v.optional(v.string()),
|
|
25
|
+
banExpires: v.optional(v.number()),
|
|
22
26
|
stripeCustomerId: v.optional(v.string()),
|
|
23
27
|
userId: v.optional(v.string()),
|
|
24
28
|
})
|
|
@@ -37,6 +41,7 @@ const schema = defineSchema({
|
|
|
37
41
|
ipAddress: v.optional(v.string()),
|
|
38
42
|
userAgent: v.optional(v.string()),
|
|
39
43
|
userId: v.string(),
|
|
44
|
+
impersonatedBy: v.optional(v.string()),
|
|
40
45
|
activeOrganizationId: v.optional(v.string()),
|
|
41
46
|
})
|
|
42
47
|
.index("expiresAt", ["expiresAt"])
|
|
@@ -136,7 +136,7 @@ export const convex = (
|
|
|
136
136
|
maxAge: jwtExpirationSeconds,
|
|
137
137
|
});
|
|
138
138
|
ctx.setCookie(jwtCookie.name, token, jwtCookie.attributes);
|
|
139
|
-
} catch (
|
|
139
|
+
} catch (_err) {
|
|
140
140
|
// no-op, some sign-in calls (eg., when redirecting to 2fa)
|
|
141
141
|
// 401 here
|
|
142
142
|
}
|