@convex-dev/better-auth 0.7.0-alpha.1 → 0.7.0-alpha.11
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/adapter.d.ts +10 -1
- package/dist/commonjs/client/adapter.d.ts.map +1 -1
- package/dist/commonjs/client/adapter.js +183 -192
- package/dist/commonjs/client/adapter.js.map +1 -1
- package/dist/commonjs/client/index.d.ts +238 -179
- package/dist/commonjs/client/index.d.ts.map +1 -1
- package/dist/commonjs/client/index.js +63 -67
- package/dist/commonjs/client/index.js.map +1 -1
- package/dist/commonjs/component/adapterTest.d.ts +19 -0
- package/dist/commonjs/component/adapterTest.d.ts.map +1 -0
- package/dist/commonjs/component/adapterTest.js +82 -0
- package/dist/commonjs/component/adapterTest.js.map +1 -0
- package/dist/commonjs/component/lib.d.ts +218 -548
- package/dist/commonjs/component/lib.d.ts.map +1 -1
- package/dist/commonjs/component/lib.js +315 -286
- package/dist/commonjs/component/lib.js.map +1 -1
- package/dist/commonjs/component/schema.d.ts +90 -28
- package/dist/commonjs/component/schema.d.ts.map +1 -1
- package/dist/commonjs/component/schema.js +76 -18
- package/dist/commonjs/component/schema.js.map +1 -1
- package/dist/commonjs/component/util.d.ts +148 -86
- package/dist/commonjs/component/util.d.ts.map +1 -1
- package/dist/commonjs/nextjs/index.d.ts.map +1 -1
- package/dist/commonjs/nextjs/index.js +12 -0
- package/dist/commonjs/nextjs/index.js.map +1 -1
- package/dist/commonjs/plugins/convex/index.d.ts +14 -11
- package/dist/commonjs/plugins/convex/index.d.ts.map +1 -1
- package/dist/commonjs/plugins/convex/index.js +10 -4
- package/dist/commonjs/plugins/convex/index.js.map +1 -1
- package/dist/commonjs/plugins/cross-domain/client.d.ts +1 -1
- package/dist/commonjs/plugins/cross-domain/index.d.ts +5 -3
- package/dist/commonjs/plugins/cross-domain/index.d.ts.map +1 -1
- package/dist/commonjs/plugins/cross-domain/index.js +19 -5
- package/dist/commonjs/plugins/cross-domain/index.js.map +1 -1
- package/dist/commonjs/react/client.d.ts +1 -1
- package/dist/commonjs/react/client.d.ts.map +1 -1
- package/dist/commonjs/react/client.js +3 -9
- package/dist/commonjs/react/client.js.map +1 -1
- package/dist/commonjs/react-start/index.d.ts +37 -3
- package/dist/commonjs/react-start/index.d.ts.map +1 -1
- package/dist/commonjs/react-start/index.js +20 -4
- package/dist/commonjs/react-start/index.js.map +1 -1
- package/dist/commonjs/utils/index.d.ts +2 -0
- package/dist/commonjs/utils/index.d.ts.map +1 -0
- package/dist/commonjs/utils/index.js +8 -0
- package/dist/commonjs/utils/index.js.map +1 -0
- package/dist/esm/client/adapter.d.ts +10 -1
- package/dist/esm/client/adapter.d.ts.map +1 -1
- package/dist/esm/client/adapter.js +183 -192
- package/dist/esm/client/adapter.js.map +1 -1
- package/dist/esm/client/index.d.ts +238 -179
- package/dist/esm/client/index.d.ts.map +1 -1
- package/dist/esm/client/index.js +63 -67
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/component/adapterTest.d.ts +19 -0
- package/dist/esm/component/adapterTest.d.ts.map +1 -0
- package/dist/esm/component/adapterTest.js +82 -0
- package/dist/esm/component/adapterTest.js.map +1 -0
- package/dist/esm/component/lib.d.ts +218 -548
- package/dist/esm/component/lib.d.ts.map +1 -1
- package/dist/esm/component/lib.js +315 -286
- package/dist/esm/component/lib.js.map +1 -1
- package/dist/esm/component/schema.d.ts +90 -28
- package/dist/esm/component/schema.d.ts.map +1 -1
- package/dist/esm/component/schema.js +76 -18
- package/dist/esm/component/schema.js.map +1 -1
- package/dist/esm/component/util.d.ts +148 -86
- package/dist/esm/component/util.d.ts.map +1 -1
- package/dist/esm/nextjs/index.d.ts.map +1 -1
- package/dist/esm/nextjs/index.js +12 -0
- package/dist/esm/nextjs/index.js.map +1 -1
- package/dist/esm/plugins/convex/index.d.ts +14 -11
- package/dist/esm/plugins/convex/index.d.ts.map +1 -1
- package/dist/esm/plugins/convex/index.js +10 -4
- package/dist/esm/plugins/convex/index.js.map +1 -1
- package/dist/esm/plugins/cross-domain/client.d.ts +1 -1
- package/dist/esm/plugins/cross-domain/index.d.ts +5 -3
- package/dist/esm/plugins/cross-domain/index.d.ts.map +1 -1
- package/dist/esm/plugins/cross-domain/index.js +19 -5
- package/dist/esm/plugins/cross-domain/index.js.map +1 -1
- package/dist/esm/react/client.d.ts +1 -1
- package/dist/esm/react/client.d.ts.map +1 -1
- package/dist/esm/react/client.js +3 -9
- package/dist/esm/react/client.js.map +1 -1
- package/dist/esm/react-start/index.d.ts +37 -3
- package/dist/esm/react-start/index.d.ts.map +1 -1
- package/dist/esm/react-start/index.js +20 -4
- package/dist/esm/react-start/index.js.map +1 -1
- package/dist/esm/utils/index.d.ts +2 -0
- package/dist/esm/utils/index.d.ts.map +1 -0
- package/dist/esm/utils/index.js +8 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/package.json +20 -5
- package/src/client/adapter.test.ts +144 -0
- package/src/client/adapter.ts +191 -195
- package/src/client/index.ts +64 -80
- package/src/component/_generated/api.d.ts +605 -149
- package/src/component/adapterTest.ts +141 -0
- package/src/component/lib.ts +444 -335
- package/src/component/schema.ts +81 -19
- package/src/nextjs/index.ts +17 -0
- package/src/plugins/convex/index.ts +12 -4
- package/src/plugins/cross-domain/index.ts +19 -5
- package/src/react/client.tsx +5 -11
- package/src/react-start/index.ts +33 -6
- package/src/react-start/vite-env.d.ts +2 -0
- package/dist/commonjs/react-router/index.d.ts +0 -10
- package/dist/commonjs/react-router/index.d.ts.map +0 -1
- package/dist/commonjs/react-router/index.js +0 -24
- package/dist/commonjs/react-router/index.js.map +0 -1
- package/dist/esm/react-router/index.d.ts +0 -10
- package/dist/esm/react-router/index.d.ts.map +0 -1
- package/dist/esm/react-router/index.js +0 -24
- package/dist/esm/react-router/index.js.map +0 -1
- package/src/client/cors.ts +0 -425
- /package/src/{util.ts → utils/index.ts} +0 -0
|
@@ -6,17 +6,23 @@ export declare const vv: {
|
|
|
6
6
|
_creationTime: number;
|
|
7
7
|
image?: string | undefined;
|
|
8
8
|
twoFactorEnabled?: boolean | undefined;
|
|
9
|
+
isAnonymous?: boolean | undefined;
|
|
10
|
+
username?: string | undefined;
|
|
11
|
+
displayUsername?: string | undefined;
|
|
12
|
+
userId?: string | undefined;
|
|
9
13
|
name: string;
|
|
10
14
|
email: string;
|
|
11
15
|
emailVerified: boolean;
|
|
12
|
-
userId: string;
|
|
13
16
|
createdAt: number;
|
|
14
17
|
updatedAt: number;
|
|
15
18
|
};
|
|
16
|
-
fieldPaths: ("name" | "email" | "emailVerified" | "image" | "twoFactorEnabled" | "
|
|
19
|
+
fieldPaths: ("name" | "email" | "emailVerified" | "image" | "createdAt" | "updatedAt" | "twoFactorEnabled" | "isAnonymous" | "username" | "displayUsername" | "userId" | "_creationTime") | "_id";
|
|
17
20
|
indexes: {
|
|
18
|
-
|
|
21
|
+
email_name: ["email", "name", "_creationTime"];
|
|
22
|
+
name: ["name", "_creationTime"];
|
|
19
23
|
userId: ["userId", "_creationTime"];
|
|
24
|
+
email: ["email", "_creationTime"];
|
|
25
|
+
username: ["username", "_creationTime"];
|
|
20
26
|
by_id: ["_id"];
|
|
21
27
|
by_creation_time: ["_creationTime"];
|
|
22
28
|
};
|
|
@@ -29,18 +35,18 @@ export declare const vv: {
|
|
|
29
35
|
_creationTime: number;
|
|
30
36
|
ipAddress?: string | undefined;
|
|
31
37
|
userAgent?: string | undefined;
|
|
32
|
-
userId: string;
|
|
33
38
|
createdAt: number;
|
|
34
39
|
updatedAt: number;
|
|
40
|
+
userId: string;
|
|
35
41
|
expiresAt: number;
|
|
36
42
|
token: string;
|
|
37
43
|
};
|
|
38
|
-
fieldPaths: ("
|
|
44
|
+
fieldPaths: ("createdAt" | "updatedAt" | "userId" | "_creationTime" | "expiresAt" | "token" | "ipAddress" | "userAgent") | "_id";
|
|
39
45
|
indexes: {
|
|
46
|
+
expiresAt: ["expiresAt", "_creationTime"];
|
|
47
|
+
expiresAt_userId: ["expiresAt", "userId", "_creationTime"];
|
|
40
48
|
token: ["token", "_creationTime"];
|
|
41
49
|
userId: ["userId", "_creationTime"];
|
|
42
|
-
expiresAt: ["expiresAt", "_creationTime"];
|
|
43
|
-
userId_expiresAt: ["userId", "expiresAt", "_creationTime"];
|
|
44
50
|
by_id: ["_id"];
|
|
45
51
|
by_creation_time: ["_creationTime"];
|
|
46
52
|
};
|
|
@@ -58,18 +64,38 @@ export declare const vv: {
|
|
|
58
64
|
refreshTokenExpiresAt?: number | undefined;
|
|
59
65
|
scope?: string | undefined;
|
|
60
66
|
password?: string | undefined;
|
|
61
|
-
userId: string;
|
|
62
67
|
createdAt: number;
|
|
63
68
|
updatedAt: number;
|
|
69
|
+
userId: string;
|
|
64
70
|
accountId: string;
|
|
65
71
|
providerId: string;
|
|
66
72
|
};
|
|
67
|
-
fieldPaths: ("
|
|
73
|
+
fieldPaths: ("createdAt" | "updatedAt" | "userId" | "_creationTime" | "accountId" | "providerId" | "accessToken" | "refreshToken" | "idToken" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "scope" | "password") | "_id";
|
|
68
74
|
indexes: {
|
|
69
|
-
userId: ["userId", "_creationTime"];
|
|
70
75
|
accountId: ["accountId", "_creationTime"];
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
accountId_providerId: ["accountId", "providerId", "_creationTime"];
|
|
77
|
+
providerId_userId: ["providerId", "userId", "_creationTime"];
|
|
78
|
+
userId: ["userId", "_creationTime"];
|
|
79
|
+
by_id: ["_id"];
|
|
80
|
+
by_creation_time: ["_creationTime"];
|
|
81
|
+
};
|
|
82
|
+
searchIndexes: {};
|
|
83
|
+
vectorIndexes: {};
|
|
84
|
+
};
|
|
85
|
+
verification: {
|
|
86
|
+
document: {
|
|
87
|
+
_id: import("convex/values").GenericId<"verification">;
|
|
88
|
+
_creationTime: number;
|
|
89
|
+
createdAt?: number | undefined;
|
|
90
|
+
updatedAt?: number | undefined;
|
|
91
|
+
expiresAt: number;
|
|
92
|
+
identifier: string;
|
|
93
|
+
value: string;
|
|
94
|
+
};
|
|
95
|
+
fieldPaths: ("createdAt" | "updatedAt" | "_creationTime" | "expiresAt" | "identifier" | "value") | "_id";
|
|
96
|
+
indexes: {
|
|
97
|
+
expiresAt: ["expiresAt", "_creationTime"];
|
|
98
|
+
identifier: ["identifier", "_creationTime"];
|
|
73
99
|
by_id: ["_id"];
|
|
74
100
|
by_creation_time: ["_creationTime"];
|
|
75
101
|
};
|
|
@@ -93,37 +119,33 @@ export declare const vv: {
|
|
|
93
119
|
searchIndexes: {};
|
|
94
120
|
vectorIndexes: {};
|
|
95
121
|
};
|
|
96
|
-
|
|
122
|
+
jwks: {
|
|
97
123
|
document: {
|
|
98
|
-
_id: import("convex/values").GenericId<"
|
|
124
|
+
_id: import("convex/values").GenericId<"jwks">;
|
|
99
125
|
_creationTime: number;
|
|
100
|
-
createdAt
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
identifier: string;
|
|
104
|
-
value: string;
|
|
126
|
+
createdAt: number;
|
|
127
|
+
publicKey: string;
|
|
128
|
+
privateKey: string;
|
|
105
129
|
};
|
|
106
|
-
fieldPaths:
|
|
130
|
+
fieldPaths: "_id" | ("createdAt" | "_creationTime" | "publicKey" | "privateKey");
|
|
107
131
|
indexes: {
|
|
108
|
-
identifier: ["identifier", "_creationTime"];
|
|
109
|
-
expiresAt: ["expiresAt", "_creationTime"];
|
|
110
132
|
by_id: ["_id"];
|
|
111
133
|
by_creation_time: ["_creationTime"];
|
|
112
134
|
};
|
|
113
135
|
searchIndexes: {};
|
|
114
136
|
vectorIndexes: {};
|
|
115
137
|
};
|
|
116
|
-
|
|
138
|
+
rateLimit: {
|
|
117
139
|
document: {
|
|
118
|
-
_id: import("convex/values").GenericId<"
|
|
140
|
+
_id: import("convex/values").GenericId<"rateLimit">;
|
|
119
141
|
_creationTime: number;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
privateKey: string;
|
|
142
|
+
key?: string | undefined;
|
|
143
|
+
count?: number | undefined;
|
|
144
|
+
lastRequest?: number | undefined;
|
|
124
145
|
};
|
|
125
|
-
fieldPaths:
|
|
146
|
+
fieldPaths: ("_creationTime" | "key" | "count" | "lastRequest") | "_id";
|
|
126
147
|
indexes: {
|
|
148
|
+
key: ["key", "_creationTime"];
|
|
127
149
|
by_id: ["_id"];
|
|
128
150
|
by_creation_time: ["_creationTime"];
|
|
129
151
|
};
|
|
@@ -138,17 +160,23 @@ export declare const vv: {
|
|
|
138
160
|
_creationTime: number;
|
|
139
161
|
image?: string | undefined;
|
|
140
162
|
twoFactorEnabled?: boolean | undefined;
|
|
163
|
+
isAnonymous?: boolean | undefined;
|
|
164
|
+
username?: string | undefined;
|
|
165
|
+
displayUsername?: string | undefined;
|
|
166
|
+
userId?: string | undefined;
|
|
141
167
|
name: string;
|
|
142
168
|
email: string;
|
|
143
169
|
emailVerified: boolean;
|
|
144
|
-
userId: string;
|
|
145
170
|
createdAt: number;
|
|
146
171
|
updatedAt: number;
|
|
147
172
|
};
|
|
148
|
-
fieldPaths: ("name" | "email" | "emailVerified" | "image" | "twoFactorEnabled" | "
|
|
173
|
+
fieldPaths: ("name" | "email" | "emailVerified" | "image" | "createdAt" | "updatedAt" | "twoFactorEnabled" | "isAnonymous" | "username" | "displayUsername" | "userId" | "_creationTime") | "_id";
|
|
149
174
|
indexes: {
|
|
150
|
-
|
|
175
|
+
email_name: ["email", "name", "_creationTime"];
|
|
176
|
+
name: ["name", "_creationTime"];
|
|
151
177
|
userId: ["userId", "_creationTime"];
|
|
178
|
+
email: ["email", "_creationTime"];
|
|
179
|
+
username: ["username", "_creationTime"];
|
|
152
180
|
by_id: ["_id"];
|
|
153
181
|
by_creation_time: ["_creationTime"];
|
|
154
182
|
};
|
|
@@ -161,18 +189,18 @@ export declare const vv: {
|
|
|
161
189
|
_creationTime: number;
|
|
162
190
|
ipAddress?: string | undefined;
|
|
163
191
|
userAgent?: string | undefined;
|
|
164
|
-
userId: string;
|
|
165
192
|
createdAt: number;
|
|
166
193
|
updatedAt: number;
|
|
194
|
+
userId: string;
|
|
167
195
|
expiresAt: number;
|
|
168
196
|
token: string;
|
|
169
197
|
};
|
|
170
|
-
fieldPaths: ("
|
|
198
|
+
fieldPaths: ("createdAt" | "updatedAt" | "userId" | "_creationTime" | "expiresAt" | "token" | "ipAddress" | "userAgent") | "_id";
|
|
171
199
|
indexes: {
|
|
200
|
+
expiresAt: ["expiresAt", "_creationTime"];
|
|
201
|
+
expiresAt_userId: ["expiresAt", "userId", "_creationTime"];
|
|
172
202
|
token: ["token", "_creationTime"];
|
|
173
203
|
userId: ["userId", "_creationTime"];
|
|
174
|
-
expiresAt: ["expiresAt", "_creationTime"];
|
|
175
|
-
userId_expiresAt: ["userId", "expiresAt", "_creationTime"];
|
|
176
204
|
by_id: ["_id"];
|
|
177
205
|
by_creation_time: ["_creationTime"];
|
|
178
206
|
};
|
|
@@ -190,18 +218,38 @@ export declare const vv: {
|
|
|
190
218
|
refreshTokenExpiresAt?: number | undefined;
|
|
191
219
|
scope?: string | undefined;
|
|
192
220
|
password?: string | undefined;
|
|
193
|
-
userId: string;
|
|
194
221
|
createdAt: number;
|
|
195
222
|
updatedAt: number;
|
|
223
|
+
userId: string;
|
|
196
224
|
accountId: string;
|
|
197
225
|
providerId: string;
|
|
198
226
|
};
|
|
199
|
-
fieldPaths: ("
|
|
227
|
+
fieldPaths: ("createdAt" | "updatedAt" | "userId" | "_creationTime" | "accountId" | "providerId" | "accessToken" | "refreshToken" | "idToken" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "scope" | "password") | "_id";
|
|
200
228
|
indexes: {
|
|
201
|
-
userId: ["userId", "_creationTime"];
|
|
202
229
|
accountId: ["accountId", "_creationTime"];
|
|
203
|
-
|
|
204
|
-
|
|
230
|
+
accountId_providerId: ["accountId", "providerId", "_creationTime"];
|
|
231
|
+
providerId_userId: ["providerId", "userId", "_creationTime"];
|
|
232
|
+
userId: ["userId", "_creationTime"];
|
|
233
|
+
by_id: ["_id"];
|
|
234
|
+
by_creation_time: ["_creationTime"];
|
|
235
|
+
};
|
|
236
|
+
searchIndexes: {};
|
|
237
|
+
vectorIndexes: {};
|
|
238
|
+
};
|
|
239
|
+
verification: {
|
|
240
|
+
document: {
|
|
241
|
+
_id: import("convex/values").GenericId<"verification">;
|
|
242
|
+
_creationTime: number;
|
|
243
|
+
createdAt?: number | undefined;
|
|
244
|
+
updatedAt?: number | undefined;
|
|
245
|
+
expiresAt: number;
|
|
246
|
+
identifier: string;
|
|
247
|
+
value: string;
|
|
248
|
+
};
|
|
249
|
+
fieldPaths: ("createdAt" | "updatedAt" | "_creationTime" | "expiresAt" | "identifier" | "value") | "_id";
|
|
250
|
+
indexes: {
|
|
251
|
+
expiresAt: ["expiresAt", "_creationTime"];
|
|
252
|
+
identifier: ["identifier", "_creationTime"];
|
|
205
253
|
by_id: ["_id"];
|
|
206
254
|
by_creation_time: ["_creationTime"];
|
|
207
255
|
};
|
|
@@ -225,37 +273,33 @@ export declare const vv: {
|
|
|
225
273
|
searchIndexes: {};
|
|
226
274
|
vectorIndexes: {};
|
|
227
275
|
};
|
|
228
|
-
|
|
276
|
+
jwks: {
|
|
229
277
|
document: {
|
|
230
|
-
_id: import("convex/values").GenericId<"
|
|
278
|
+
_id: import("convex/values").GenericId<"jwks">;
|
|
231
279
|
_creationTime: number;
|
|
232
|
-
createdAt
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
identifier: string;
|
|
236
|
-
value: string;
|
|
280
|
+
createdAt: number;
|
|
281
|
+
publicKey: string;
|
|
282
|
+
privateKey: string;
|
|
237
283
|
};
|
|
238
|
-
fieldPaths:
|
|
284
|
+
fieldPaths: "_id" | ("createdAt" | "_creationTime" | "publicKey" | "privateKey");
|
|
239
285
|
indexes: {
|
|
240
|
-
identifier: ["identifier", "_creationTime"];
|
|
241
|
-
expiresAt: ["expiresAt", "_creationTime"];
|
|
242
286
|
by_id: ["_id"];
|
|
243
287
|
by_creation_time: ["_creationTime"];
|
|
244
288
|
};
|
|
245
289
|
searchIndexes: {};
|
|
246
290
|
vectorIndexes: {};
|
|
247
291
|
};
|
|
248
|
-
|
|
292
|
+
rateLimit: {
|
|
249
293
|
document: {
|
|
250
|
-
_id: import("convex/values").GenericId<"
|
|
294
|
+
_id: import("convex/values").GenericId<"rateLimit">;
|
|
251
295
|
_creationTime: number;
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
privateKey: string;
|
|
296
|
+
key?: string | undefined;
|
|
297
|
+
count?: number | undefined;
|
|
298
|
+
lastRequest?: number | undefined;
|
|
256
299
|
};
|
|
257
|
-
fieldPaths:
|
|
300
|
+
fieldPaths: ("_creationTime" | "key" | "count" | "lastRequest") | "_id";
|
|
258
301
|
indexes: {
|
|
302
|
+
key: ["key", "_creationTime"];
|
|
259
303
|
by_id: ["_id"];
|
|
260
304
|
by_creation_time: ["_creationTime"];
|
|
261
305
|
};
|
|
@@ -266,10 +310,13 @@ export declare const vv: {
|
|
|
266
310
|
user: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
267
311
|
image?: string | undefined;
|
|
268
312
|
twoFactorEnabled?: boolean | undefined;
|
|
313
|
+
isAnonymous?: boolean | undefined;
|
|
314
|
+
username?: string | undefined;
|
|
315
|
+
displayUsername?: string | undefined;
|
|
316
|
+
userId?: string | undefined;
|
|
269
317
|
name: string;
|
|
270
318
|
email: string;
|
|
271
319
|
emailVerified: boolean;
|
|
272
|
-
userId: string;
|
|
273
320
|
createdAt: number;
|
|
274
321
|
updatedAt: number;
|
|
275
322
|
}, {
|
|
@@ -277,20 +324,26 @@ export declare const vv: {
|
|
|
277
324
|
email: import("convex/values").VString<string, "required">;
|
|
278
325
|
emailVerified: import("convex/values").VBoolean<boolean, "required">;
|
|
279
326
|
image: import("convex/values").VString<string | undefined, "optional">;
|
|
280
|
-
twoFactorEnabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
281
|
-
userId: import("convex/values").VString<string, "required">;
|
|
282
327
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
283
328
|
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
284
|
-
|
|
285
|
-
|
|
329
|
+
twoFactorEnabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
330
|
+
isAnonymous: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
331
|
+
username: import("convex/values").VString<string | undefined, "optional">;
|
|
332
|
+
displayUsername: import("convex/values").VString<string | undefined, "optional">;
|
|
333
|
+
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
334
|
+
}, "required", "name" | "email" | "emailVerified" | "image" | "createdAt" | "updatedAt" | "twoFactorEnabled" | "isAnonymous" | "username" | "displayUsername" | "userId">, {
|
|
335
|
+
email_name: ["email", "name", "_creationTime"];
|
|
336
|
+
name: ["name", "_creationTime"];
|
|
286
337
|
userId: ["userId", "_creationTime"];
|
|
338
|
+
email: ["email", "_creationTime"];
|
|
339
|
+
username: ["username", "_creationTime"];
|
|
287
340
|
}, {}, {}>;
|
|
288
341
|
session: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
289
342
|
ipAddress?: string | undefined;
|
|
290
343
|
userAgent?: string | undefined;
|
|
291
|
-
userId: string;
|
|
292
344
|
createdAt: number;
|
|
293
345
|
updatedAt: number;
|
|
346
|
+
userId: string;
|
|
294
347
|
expiresAt: number;
|
|
295
348
|
token: string;
|
|
296
349
|
}, {
|
|
@@ -301,11 +354,11 @@ export declare const vv: {
|
|
|
301
354
|
ipAddress: import("convex/values").VString<string | undefined, "optional">;
|
|
302
355
|
userAgent: import("convex/values").VString<string | undefined, "optional">;
|
|
303
356
|
userId: import("convex/values").VString<string, "required">;
|
|
304
|
-
}, "required", "
|
|
357
|
+
}, "required", "createdAt" | "updatedAt" | "userId" | "expiresAt" | "token" | "ipAddress" | "userAgent">, {
|
|
358
|
+
expiresAt: ["expiresAt", "_creationTime"];
|
|
359
|
+
expiresAt_userId: ["expiresAt", "userId", "_creationTime"];
|
|
305
360
|
token: ["token", "_creationTime"];
|
|
306
361
|
userId: ["userId", "_creationTime"];
|
|
307
|
-
expiresAt: ["expiresAt", "_creationTime"];
|
|
308
|
-
userId_expiresAt: ["userId", "expiresAt", "_creationTime"];
|
|
309
362
|
}, {}, {}>;
|
|
310
363
|
account: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
311
364
|
accessToken?: string | undefined;
|
|
@@ -315,9 +368,9 @@ export declare const vv: {
|
|
|
315
368
|
refreshTokenExpiresAt?: number | undefined;
|
|
316
369
|
scope?: string | undefined;
|
|
317
370
|
password?: string | undefined;
|
|
318
|
-
userId: string;
|
|
319
371
|
createdAt: number;
|
|
320
372
|
updatedAt: number;
|
|
373
|
+
userId: string;
|
|
321
374
|
accountId: string;
|
|
322
375
|
providerId: string;
|
|
323
376
|
}, {
|
|
@@ -333,21 +386,10 @@ export declare const vv: {
|
|
|
333
386
|
password: import("convex/values").VString<string | undefined, "optional">;
|
|
334
387
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
335
388
|
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
336
|
-
}, "required", "
|
|
337
|
-
userId: ["userId", "_creationTime"];
|
|
389
|
+
}, "required", "createdAt" | "updatedAt" | "userId" | "accountId" | "providerId" | "accessToken" | "refreshToken" | "idToken" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "scope" | "password">, {
|
|
338
390
|
accountId: ["accountId", "_creationTime"];
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}, {}, {}>;
|
|
342
|
-
twoFactor: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
343
|
-
userId: string;
|
|
344
|
-
secret: string;
|
|
345
|
-
backupCodes: string;
|
|
346
|
-
}, {
|
|
347
|
-
secret: import("convex/values").VString<string, "required">;
|
|
348
|
-
backupCodes: import("convex/values").VString<string, "required">;
|
|
349
|
-
userId: import("convex/values").VString<string, "required">;
|
|
350
|
-
}, "required", "userId" | "secret" | "backupCodes">, {
|
|
391
|
+
accountId_providerId: ["accountId", "providerId", "_creationTime"];
|
|
392
|
+
providerId_userId: ["providerId", "userId", "_creationTime"];
|
|
351
393
|
userId: ["userId", "_creationTime"];
|
|
352
394
|
}, {}, {}>;
|
|
353
395
|
verification: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
@@ -363,11 +405,21 @@ export declare const vv: {
|
|
|
363
405
|
createdAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
364
406
|
updatedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
365
407
|
}, "required", "createdAt" | "updatedAt" | "expiresAt" | "identifier" | "value">, {
|
|
366
|
-
identifier: ["identifier", "_creationTime"];
|
|
367
408
|
expiresAt: ["expiresAt", "_creationTime"];
|
|
409
|
+
identifier: ["identifier", "_creationTime"];
|
|
410
|
+
}, {}, {}>;
|
|
411
|
+
twoFactor: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
412
|
+
userId: string;
|
|
413
|
+
secret: string;
|
|
414
|
+
backupCodes: string;
|
|
415
|
+
}, {
|
|
416
|
+
secret: import("convex/values").VString<string, "required">;
|
|
417
|
+
backupCodes: import("convex/values").VString<string, "required">;
|
|
418
|
+
userId: import("convex/values").VString<string, "required">;
|
|
419
|
+
}, "required", "userId" | "secret" | "backupCodes">, {
|
|
420
|
+
userId: ["userId", "_creationTime"];
|
|
368
421
|
}, {}, {}>;
|
|
369
422
|
jwks: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
370
|
-
id?: string | undefined;
|
|
371
423
|
createdAt: number;
|
|
372
424
|
publicKey: string;
|
|
373
425
|
privateKey: string;
|
|
@@ -375,8 +427,18 @@ export declare const vv: {
|
|
|
375
427
|
publicKey: import("convex/values").VString<string, "required">;
|
|
376
428
|
privateKey: import("convex/values").VString<string, "required">;
|
|
377
429
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
378
|
-
|
|
379
|
-
|
|
430
|
+
}, "required", "createdAt" | "publicKey" | "privateKey">, {}, {}, {}>;
|
|
431
|
+
rateLimit: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
432
|
+
key?: string | undefined;
|
|
433
|
+
count?: number | undefined;
|
|
434
|
+
lastRequest?: number | undefined;
|
|
435
|
+
}, {
|
|
436
|
+
key: import("convex/values").VString<string | undefined, "optional">;
|
|
437
|
+
count: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
438
|
+
lastRequest: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
439
|
+
}, "required", "key" | "count" | "lastRequest">, {
|
|
440
|
+
key: ["key", "_creationTime"];
|
|
441
|
+
}, {}, {}>;
|
|
380
442
|
}[TableName]["validator"], {
|
|
381
443
|
_id: import("convex/values").VId<import("convex/values").GenericId<TableName>, "required">;
|
|
382
444
|
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/component/util.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/component/util.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gMACstS,eAAgB,qEAAqE,CAAC,mJAA0H,aAAc,+MAAuL,eAAe;;mFAAkV,GAAG,gDAAwB,WAAW,2BAA0B,WAAY;;;CADvgU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/nextjs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/nextjs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAcjD,eAAO,MAAM,QAAQ,GACnB,YAAY,CAAC,GAAG,EAAE,gBAAgB,CAAC,GAAG,CAAC,KAAK,UAAU,CAAC,OAAO,UAAU,CAAC,gCAY1E,CAAC;AAeF,eAAO,MAAM,aAAa,GAAI,OAAO;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE;mBAC9C,OAAO;oBACN,OAAO;CACvB,CAAC"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { createCookieGetter } from "better-auth/cookies";
|
|
2
2
|
import { JWT_COOKIE_NAME } from "../plugins/convex";
|
|
3
|
+
const requireBaseURL = (createAuth) => {
|
|
4
|
+
if (!createAuth({}).options.baseURL) {
|
|
5
|
+
throw new Error("No baseURL found in Better Auth config. baseUrl should be set to your Convex Site URL.");
|
|
6
|
+
}
|
|
7
|
+
return createAuth({}).options.baseURL;
|
|
8
|
+
};
|
|
3
9
|
export const getToken = async (createAuth) => {
|
|
10
|
+
// Require baseURL here because it's protocol determines cookie secure mode,
|
|
11
|
+
// and must be set to ensure cookies work between Next.js and Convex.
|
|
12
|
+
requireBaseURL(createAuth);
|
|
4
13
|
const { cookies } = await import("next/headers");
|
|
5
14
|
const cookieStore = await cookies();
|
|
6
15
|
const auth = createAuth({});
|
|
@@ -12,6 +21,9 @@ export const getToken = async (createAuth) => {
|
|
|
12
21
|
const handler = (request, opts) => {
|
|
13
22
|
const requestUrl = new URL(request.url);
|
|
14
23
|
const convexSiteUrl = opts?.convexSiteUrl ?? process.env.NEXT_PUBLIC_CONVEX_SITE_URL;
|
|
24
|
+
if (!convexSiteUrl) {
|
|
25
|
+
throw new Error("NEXT_PUBLIC_CONVEX_SITE_URL is not set");
|
|
26
|
+
}
|
|
15
27
|
const nextUrl = `${convexSiteUrl}${requestUrl.pathname}${requestUrl.search}`;
|
|
16
28
|
const newRequest = new Request(nextUrl, request);
|
|
17
29
|
newRequest.headers.set("accept-encoding", "application/json");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nextjs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAC3B,UAAyE,EACzE,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,MAAM,OAAO,EAAE,CAAC;IACpC,MAAM,IAAI,GAAG,UAAU,CAAC,EAAS,CAAC,CAAC;IACnC,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,KAAK,EAAE,KAAK,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,OAAgB,EAAE,IAAiC,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,aAAa,GACjB,IAAI,EAAE,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC;IACjE,MAAM,OAAO,GAAG,GAAG,aAAa,GAAG,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;IAC7E,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACjD,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;IAC9D,OAAO,KAAK,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAiC,EAAE,EAAE,CAAC,CAAC;IACnE,GAAG,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;IACjD,IAAI,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;CACnD,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nextjs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,cAAc,GAAG,CACrB,UAAyE,EACzE,EAAE;IACF,IAAI,CAAC,UAAU,CAAC,EAAS,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC,EAAS,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAC3B,UAAyE,EACzE,EAAE;IACF,4EAA4E;IAC5E,qEAAqE;IACrE,cAAc,CAAC,UAAU,CAAC,CAAC;IAC3B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,MAAM,OAAO,EAAE,CAAC;IACpC,MAAM,IAAI,GAAG,UAAU,CAAC,EAAS,CAAC,CAAC;IACnC,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,KAAK,EAAE,KAAK,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,OAAgB,EAAE,IAAiC,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,aAAa,GACjB,IAAI,EAAE,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC;IACjE,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,aAAa,GAAG,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;IAC7E,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACjD,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;IAC9D,OAAO,KAAK,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAiC,EAAE,EAAE,CAAC,CAAC;IACnE,GAAG,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;IACjD,IAAI,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;CACnD,CAAC,CAAC"}
|
|
@@ -16,7 +16,10 @@ export declare const convex: (opts?: {
|
|
|
16
16
|
}[];
|
|
17
17
|
after: ({
|
|
18
18
|
matcher(): true;
|
|
19
|
-
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<Response |
|
|
19
|
+
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<Response | {
|
|
20
|
+
redirect: boolean;
|
|
21
|
+
url: string;
|
|
22
|
+
} | undefined>;
|
|
20
23
|
} | {
|
|
21
24
|
matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
|
|
22
25
|
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>;
|
|
@@ -53,8 +56,8 @@ export declare const convex: (opts?: {
|
|
|
53
56
|
user: {
|
|
54
57
|
id: string;
|
|
55
58
|
name: string;
|
|
56
|
-
email: string;
|
|
57
59
|
emailVerified: boolean;
|
|
60
|
+
email: string;
|
|
58
61
|
createdAt: Date;
|
|
59
62
|
updatedAt: Date;
|
|
60
63
|
image?: string | null | undefined | undefined;
|
|
@@ -62,10 +65,10 @@ export declare const convex: (opts?: {
|
|
|
62
65
|
session: {
|
|
63
66
|
userId: string;
|
|
64
67
|
id: string;
|
|
68
|
+
token: string;
|
|
69
|
+
expiresAt: Date;
|
|
65
70
|
createdAt: Date;
|
|
66
71
|
updatedAt: Date;
|
|
67
|
-
expiresAt: Date;
|
|
68
|
-
token: string;
|
|
69
72
|
ipAddress?: string | null | undefined | undefined;
|
|
70
73
|
userAgent?: string | null | undefined | undefined;
|
|
71
74
|
};
|
|
@@ -74,8 +77,8 @@ export declare const convex: (opts?: {
|
|
|
74
77
|
user: {
|
|
75
78
|
id: string;
|
|
76
79
|
name: string;
|
|
77
|
-
email: string;
|
|
78
80
|
emailVerified: boolean;
|
|
81
|
+
email: string;
|
|
79
82
|
createdAt: Date;
|
|
80
83
|
updatedAt: Date;
|
|
81
84
|
image?: string | null | undefined | undefined;
|
|
@@ -83,10 +86,10 @@ export declare const convex: (opts?: {
|
|
|
83
86
|
session: {
|
|
84
87
|
userId: string;
|
|
85
88
|
id: string;
|
|
89
|
+
token: string;
|
|
90
|
+
expiresAt: Date;
|
|
86
91
|
createdAt: Date;
|
|
87
92
|
updatedAt: Date;
|
|
88
|
-
expiresAt: Date;
|
|
89
|
-
token: string;
|
|
90
93
|
ipAddress?: string | null | undefined | undefined;
|
|
91
94
|
userAgent?: string | null | undefined | undefined;
|
|
92
95
|
};
|
|
@@ -311,19 +314,19 @@ export declare const convex: (opts?: {
|
|
|
311
314
|
session: {
|
|
312
315
|
session: Record<string, any> & {
|
|
313
316
|
id: string;
|
|
314
|
-
|
|
315
|
-
updatedAt: Date;
|
|
317
|
+
token: string;
|
|
316
318
|
userId: string;
|
|
317
319
|
expiresAt: Date;
|
|
318
|
-
|
|
320
|
+
createdAt: Date;
|
|
321
|
+
updatedAt: Date;
|
|
319
322
|
ipAddress?: string | null | undefined;
|
|
320
323
|
userAgent?: string | null | undefined;
|
|
321
324
|
};
|
|
322
325
|
user: Record<string, any> & {
|
|
323
326
|
id: string;
|
|
324
327
|
name: string;
|
|
325
|
-
email: string;
|
|
326
328
|
emailVerified: boolean;
|
|
329
|
+
email: string;
|
|
327
330
|
createdAt: Date;
|
|
328
331
|
updatedAt: Date;
|
|
329
332
|
image?: string | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/convex/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C,eAAO,MAAM,MAAM,GACjB,OAAM;IACJ,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CACnC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/convex/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C,eAAO,MAAM,MAAM,GACjB,OAAM;IACJ,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAkW+84F,CAAC;qCAAkD,CAAC;;;;;;;;;iCAA0Q,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADrx5F,CAAC"}
|
|
@@ -32,7 +32,7 @@ export const convex = (opts = {}) => {
|
|
|
32
32
|
return session.user.userId;
|
|
33
33
|
},
|
|
34
34
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
35
|
-
definePayload: ({ user: { id, userId, ...user }, session }) => ({
|
|
35
|
+
definePayload: ({ user: { id, userId, image, ...user }, session }) => ({
|
|
36
36
|
...user,
|
|
37
37
|
sessionId: session.id,
|
|
38
38
|
}),
|
|
@@ -86,8 +86,13 @@ export const convex = (opts = {}) => {
|
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
matcher: (ctx) => {
|
|
89
|
-
return (ctx.path
|
|
90
|
-
ctx.path
|
|
89
|
+
return (ctx.path.startsWith("/sign-in") ||
|
|
90
|
+
ctx.path.startsWith("/sign-up") ||
|
|
91
|
+
ctx.path.startsWith("/callback") ||
|
|
92
|
+
ctx.path.startsWith("/oauth2/callback") ||
|
|
93
|
+
ctx.path.startsWith("/magic-link/verify") ||
|
|
94
|
+
ctx.path.startsWith("/email-otp/verify-email") ||
|
|
95
|
+
ctx.path.startsWith("/phone-number/verify"));
|
|
91
96
|
},
|
|
92
97
|
handler: createAuthMiddleware(async (ctx) => {
|
|
93
98
|
// Set jwt cookie at login for ssa
|
|
@@ -117,7 +122,8 @@ export const convex = (opts = {}) => {
|
|
|
117
122
|
},
|
|
118
123
|
{
|
|
119
124
|
matcher: (ctx) => {
|
|
120
|
-
return ctx.path?.startsWith("/sign-out")
|
|
125
|
+
return (ctx.path?.startsWith("/sign-out") ||
|
|
126
|
+
ctx.path?.startsWith("/delete-user"));
|
|
121
127
|
},
|
|
122
128
|
handler: createAuthMiddleware(async (ctx) => {
|
|
123
129
|
const jwtCookie = ctx.context.createAuthCookie(JWT_COOKIE_NAME, {
|