better-auth 1.4.18 → 1.4.19
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/adapters/drizzle-adapter/drizzle-adapter.mjs +37 -5
- package/dist/adapters/drizzle-adapter/drizzle-adapter.mjs.map +1 -1
- package/dist/adapters/kysely-adapter/kysely-adapter.mjs +13 -3
- package/dist/adapters/kysely-adapter/kysely-adapter.mjs.map +1 -1
- package/dist/adapters/memory-adapter/memory-adapter.mjs +21 -17
- package/dist/adapters/memory-adapter/memory-adapter.mjs.map +1 -1
- package/dist/adapters/mongodb-adapter/mongodb-adapter.mjs +12 -1
- package/dist/adapters/mongodb-adapter/mongodb-adapter.mjs.map +1 -1
- package/dist/adapters/prisma-adapter/prisma-adapter.mjs +2 -2
- package/dist/adapters/prisma-adapter/prisma-adapter.mjs.map +1 -1
- package/dist/api/index.d.mts +407 -407
- package/dist/api/routes/account.d.mts +11 -11
- package/dist/api/routes/account.mjs +1 -1
- package/dist/api/routes/account.mjs.map +1 -1
- package/dist/api/routes/callback.d.mts +2 -2
- package/dist/api/routes/callback.mjs +1 -1
- package/dist/api/routes/callback.mjs.map +1 -1
- package/dist/api/routes/email-verification.d.mts +4 -4
- package/dist/api/routes/email-verification.mjs +1 -1
- package/dist/api/routes/email-verification.mjs.map +1 -1
- package/dist/api/routes/error.d.mts +2 -2
- package/dist/api/routes/ok.d.mts +2 -2
- package/dist/api/routes/password.d.mts +7 -7
- package/dist/api/routes/session.d.mts +14 -14
- package/dist/api/routes/sign-in.d.mts +4 -4
- package/dist/api/routes/sign-out.d.mts +2 -2
- package/dist/api/routes/sign-up.d.mts +3 -3
- package/dist/api/routes/update-user.d.mts +13 -13
- package/dist/api/routes/update-user.mjs +1 -1
- package/dist/api/routes/update-user.mjs.map +1 -1
- package/dist/client/react/index.d.mts +13 -13
- package/dist/client/svelte/index.d.mts +15 -15
- package/dist/client/vanilla.d.mts +15 -15
- package/dist/client/vue/index.d.mts +15 -15
- package/dist/context/create-context.mjs +1 -1
- package/dist/context/create-context.mjs.map +1 -1
- package/dist/cookies/index.d.mts +6 -6
- package/dist/cookies/index.mjs +5 -8
- package/dist/cookies/index.mjs.map +1 -1
- package/dist/db/field.d.mts +10 -10
- package/dist/db/field.mjs.map +1 -1
- package/dist/db/internal-adapter.mjs +1 -1
- package/dist/db/internal-adapter.mjs.map +1 -1
- package/dist/integrations/next-js.d.mts +4 -4
- package/dist/integrations/svelte-kit.d.mts +2 -2
- package/dist/integrations/tanstack-start-solid.d.mts +4 -4
- package/dist/integrations/tanstack-start.d.mts +4 -4
- package/dist/plugins/access/types.d.mts +1 -1
- package/dist/plugins/admin/admin.d.mts +114 -119
- package/dist/plugins/admin/admin.mjs +1 -1
- package/dist/plugins/admin/admin.mjs.map +1 -1
- package/dist/plugins/admin/routes.mjs +1 -1
- package/dist/plugins/admin/routes.mjs.map +1 -1
- package/dist/plugins/anonymous/index.d.mts +7 -7
- package/dist/plugins/api-key/index.d.mts +95 -80
- package/dist/plugins/api-key/routes/verify-api-key.mjs +1 -0
- package/dist/plugins/api-key/routes/verify-api-key.mjs.map +1 -1
- package/dist/plugins/bearer/index.d.mts +6 -6
- package/dist/plugins/captcha/index.d.mts +2 -2
- package/dist/plugins/custom-session/index.d.mts +5 -5
- package/dist/plugins/custom-session/index.mjs +13 -5
- package/dist/plugins/custom-session/index.mjs.map +1 -1
- package/dist/plugins/device-authorization/index.d.mts +6 -6
- package/dist/plugins/email-otp/index.d.mts +16 -16
- package/dist/plugins/email-otp/routes.mjs +1 -1
- package/dist/plugins/email-otp/routes.mjs.map +1 -1
- package/dist/plugins/generic-oauth/error-codes.mjs +3 -1
- package/dist/plugins/generic-oauth/error-codes.mjs.map +1 -1
- package/dist/plugins/generic-oauth/index.d.mts +32 -29
- package/dist/plugins/generic-oauth/index.mjs +8 -0
- package/dist/plugins/generic-oauth/index.mjs.map +1 -1
- package/dist/plugins/generic-oauth/routes.mjs +19 -2
- package/dist/plugins/generic-oauth/routes.mjs.map +1 -1
- package/dist/plugins/generic-oauth/types.d.mts +14 -0
- package/dist/plugins/haveibeenpwned/index.d.mts +3 -3
- package/dist/plugins/jwt/client.d.mts +2 -2
- package/dist/plugins/jwt/index.d.mts +9 -9
- package/dist/plugins/last-login-method/index.d.mts +4 -4
- package/dist/plugins/magic-link/index.d.mts +4 -4
- package/dist/plugins/mcp/authorize.mjs +1 -1
- package/dist/plugins/mcp/authorize.mjs.map +1 -1
- package/dist/plugins/mcp/index.d.mts +10 -10
- package/dist/plugins/multi-session/index.d.mts +9 -9
- package/dist/plugins/oauth-proxy/index.d.mts +8 -8
- package/dist/plugins/oidc-provider/authorize.mjs +1 -1
- package/dist/plugins/oidc-provider/authorize.mjs.map +1 -1
- package/dist/plugins/oidc-provider/index.d.mts +15 -15
- package/dist/plugins/one-tap/client.d.mts +5 -5
- package/dist/plugins/one-tap/index.d.mts +2 -2
- package/dist/plugins/one-time-token/index.d.mts +5 -5
- package/dist/plugins/open-api/index.d.mts +3 -3
- package/dist/plugins/organization/client.d.mts +9 -9
- package/dist/plugins/organization/error-codes.d.mts +1 -0
- package/dist/plugins/organization/error-codes.mjs +2 -1
- package/dist/plugins/organization/error-codes.mjs.map +1 -1
- package/dist/plugins/organization/organization.d.mts +4 -4
- package/dist/plugins/organization/routes/crud-access-control.d.mts +22 -22
- package/dist/plugins/organization/routes/crud-access-control.mjs +22 -0
- package/dist/plugins/organization/routes/crud-access-control.mjs.map +1 -1
- package/dist/plugins/organization/routes/crud-invites.d.mts +70 -70
- package/dist/plugins/organization/routes/crud-invites.mjs +0 -4
- package/dist/plugins/organization/routes/crud-invites.mjs.map +1 -1
- package/dist/plugins/organization/routes/crud-members.d.mts +67 -67
- package/dist/plugins/organization/routes/crud-org.d.mts +59 -59
- package/dist/plugins/organization/routes/crud-team.d.mts +79 -79
- package/dist/plugins/phone-number/index.d.mts +33 -33
- package/dist/plugins/phone-number/routes.mjs +6 -2
- package/dist/plugins/phone-number/routes.mjs.map +1 -1
- package/dist/plugins/siwe/index.d.mts +3 -3
- package/dist/plugins/two-factor/backup-codes/index.d.mts +5 -5
- package/dist/plugins/two-factor/client.d.mts +2 -2
- package/dist/plugins/two-factor/index.d.mts +18 -18
- package/dist/plugins/two-factor/otp/index.d.mts +3 -3
- package/dist/plugins/two-factor/totp/index.d.mts +5 -5
- package/dist/plugins/username/index.d.mts +12 -12
- package/dist/plugins/username/schema.d.mts +3 -3
- package/dist/test-utils/test-instance.d.mts +1242 -1242
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AccessControl, Statements } from "../access/types.mjs";
|
|
2
2
|
import { AdminOptions, InferAdminRolesFromOption, SessionWithImpersonatedBy, UserWithRole } from "./types.mjs";
|
|
3
3
|
import "../index.mjs";
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
4
|
+
import * as _better_auth_core43 from "@better-auth/core";
|
|
5
|
+
import * as _better_auth_core_db23 from "@better-auth/core/db";
|
|
6
|
+
import * as better_call706 from "better-call";
|
|
7
|
+
import * as zod1930 from "zod";
|
|
8
|
+
import * as zod_v4_core269 from "zod/v4/core";
|
|
9
9
|
|
|
10
10
|
//#region src/plugins/admin/admin.d.ts
|
|
11
11
|
declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
@@ -48,7 +48,7 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
48
48
|
token: string;
|
|
49
49
|
ipAddress?: string | null | undefined;
|
|
50
50
|
userAgent?: string | null | undefined;
|
|
51
|
-
} & Record<string, unknown>, ctx:
|
|
51
|
+
} & Record<string, unknown>, ctx: _better_auth_core43.GenericEndpointContext | null): Promise<void>;
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
};
|
|
@@ -56,22 +56,22 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
56
56
|
};
|
|
57
57
|
hooks: {
|
|
58
58
|
after: {
|
|
59
|
-
matcher(context:
|
|
60
|
-
handler: (inputContext:
|
|
59
|
+
matcher(context: _better_auth_core43.HookEndpointContext): boolean;
|
|
60
|
+
handler: (inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<SessionWithImpersonatedBy[] | undefined>;
|
|
61
61
|
}[];
|
|
62
62
|
};
|
|
63
63
|
endpoints: {
|
|
64
|
-
setRole:
|
|
64
|
+
setRole: better_call706.StrictEndpoint<"/admin/set-role", {
|
|
65
65
|
method: "POST";
|
|
66
|
-
body:
|
|
67
|
-
userId:
|
|
68
|
-
role:
|
|
69
|
-
},
|
|
66
|
+
body: zod1930.ZodObject<{
|
|
67
|
+
userId: zod1930.ZodCoercedString<unknown>;
|
|
68
|
+
role: zod1930.ZodUnion<readonly [zod1930.ZodString, zod1930.ZodArray<zod1930.ZodString>]>;
|
|
69
|
+
}, zod_v4_core269.$strip>;
|
|
70
70
|
requireHeaders: true;
|
|
71
|
-
use: ((inputContext:
|
|
71
|
+
use: ((inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<{
|
|
72
72
|
session: {
|
|
73
73
|
user: UserWithRole;
|
|
74
|
-
session:
|
|
74
|
+
session: _better_auth_core_db23.Session;
|
|
75
75
|
};
|
|
76
76
|
}>)[];
|
|
77
77
|
metadata: {
|
|
@@ -107,15 +107,15 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
107
107
|
}, {
|
|
108
108
|
user: UserWithRole;
|
|
109
109
|
}>;
|
|
110
|
-
getUser:
|
|
110
|
+
getUser: better_call706.StrictEndpoint<"/admin/get-user", {
|
|
111
111
|
method: "GET";
|
|
112
|
-
query:
|
|
113
|
-
id:
|
|
114
|
-
},
|
|
115
|
-
use: ((inputContext:
|
|
112
|
+
query: zod1930.ZodObject<{
|
|
113
|
+
id: zod1930.ZodString;
|
|
114
|
+
}, zod_v4_core269.$strip>;
|
|
115
|
+
use: ((inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<{
|
|
116
116
|
session: {
|
|
117
117
|
user: UserWithRole;
|
|
118
|
-
session:
|
|
118
|
+
session: _better_auth_core_db23.Session;
|
|
119
119
|
};
|
|
120
120
|
}>)[];
|
|
121
121
|
metadata: {
|
|
@@ -143,15 +143,15 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
143
143
|
};
|
|
144
144
|
};
|
|
145
145
|
}, UserWithRole>;
|
|
146
|
-
createUser:
|
|
146
|
+
createUser: better_call706.StrictEndpoint<"/admin/create-user", {
|
|
147
147
|
method: "POST";
|
|
148
|
-
body:
|
|
149
|
-
email:
|
|
150
|
-
password:
|
|
151
|
-
name:
|
|
152
|
-
role:
|
|
153
|
-
data:
|
|
154
|
-
},
|
|
148
|
+
body: zod1930.ZodObject<{
|
|
149
|
+
email: zod1930.ZodString;
|
|
150
|
+
password: zod1930.ZodOptional<zod1930.ZodString>;
|
|
151
|
+
name: zod1930.ZodString;
|
|
152
|
+
role: zod1930.ZodOptional<zod1930.ZodUnion<readonly [zod1930.ZodString, zod1930.ZodArray<zod1930.ZodString>]>>;
|
|
153
|
+
data: zod1930.ZodOptional<zod1930.ZodRecord<zod1930.ZodString, zod1930.ZodAny>>;
|
|
154
|
+
}, zod_v4_core269.$strip>;
|
|
155
155
|
metadata: {
|
|
156
156
|
openapi: {
|
|
157
157
|
operationId: string;
|
|
@@ -188,16 +188,16 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
188
188
|
}, {
|
|
189
189
|
user: UserWithRole;
|
|
190
190
|
}>;
|
|
191
|
-
adminUpdateUser:
|
|
191
|
+
adminUpdateUser: better_call706.StrictEndpoint<"/admin/update-user", {
|
|
192
192
|
method: "POST";
|
|
193
|
-
body:
|
|
194
|
-
userId:
|
|
195
|
-
data:
|
|
196
|
-
},
|
|
197
|
-
use: ((inputContext:
|
|
193
|
+
body: zod1930.ZodObject<{
|
|
194
|
+
userId: zod1930.ZodCoercedString<unknown>;
|
|
195
|
+
data: zod1930.ZodRecord<zod1930.ZodAny, zod1930.ZodAny>;
|
|
196
|
+
}, zod_v4_core269.$strip>;
|
|
197
|
+
use: ((inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<{
|
|
198
198
|
session: {
|
|
199
199
|
user: UserWithRole;
|
|
200
|
-
session:
|
|
200
|
+
session: _better_auth_core_db23.Session;
|
|
201
201
|
};
|
|
202
202
|
}>)[];
|
|
203
203
|
metadata: {
|
|
@@ -225,35 +225,35 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
225
225
|
};
|
|
226
226
|
};
|
|
227
227
|
}, UserWithRole>;
|
|
228
|
-
listUsers:
|
|
228
|
+
listUsers: better_call706.StrictEndpoint<"/admin/list-users", {
|
|
229
229
|
method: "GET";
|
|
230
|
-
use: ((inputContext:
|
|
230
|
+
use: ((inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<{
|
|
231
231
|
session: {
|
|
232
232
|
user: UserWithRole;
|
|
233
|
-
session:
|
|
233
|
+
session: _better_auth_core_db23.Session;
|
|
234
234
|
};
|
|
235
235
|
}>)[];
|
|
236
|
-
query:
|
|
237
|
-
searchValue:
|
|
238
|
-
searchField:
|
|
236
|
+
query: zod1930.ZodObject<{
|
|
237
|
+
searchValue: zod1930.ZodOptional<zod1930.ZodString>;
|
|
238
|
+
searchField: zod1930.ZodOptional<zod1930.ZodEnum<{
|
|
239
239
|
name: "name";
|
|
240
240
|
email: "email";
|
|
241
241
|
}>>;
|
|
242
|
-
searchOperator:
|
|
242
|
+
searchOperator: zod1930.ZodOptional<zod1930.ZodEnum<{
|
|
243
243
|
contains: "contains";
|
|
244
244
|
starts_with: "starts_with";
|
|
245
245
|
ends_with: "ends_with";
|
|
246
246
|
}>>;
|
|
247
|
-
limit:
|
|
248
|
-
offset:
|
|
249
|
-
sortBy:
|
|
250
|
-
sortDirection:
|
|
247
|
+
limit: zod1930.ZodOptional<zod1930.ZodUnion<[zod1930.ZodString, zod1930.ZodNumber]>>;
|
|
248
|
+
offset: zod1930.ZodOptional<zod1930.ZodUnion<[zod1930.ZodString, zod1930.ZodNumber]>>;
|
|
249
|
+
sortBy: zod1930.ZodOptional<zod1930.ZodString>;
|
|
250
|
+
sortDirection: zod1930.ZodOptional<zod1930.ZodEnum<{
|
|
251
251
|
asc: "asc";
|
|
252
252
|
desc: "desc";
|
|
253
253
|
}>>;
|
|
254
|
-
filterField:
|
|
255
|
-
filterValue:
|
|
256
|
-
filterOperator:
|
|
254
|
+
filterField: zod1930.ZodOptional<zod1930.ZodString>;
|
|
255
|
+
filterValue: zod1930.ZodOptional<zod1930.ZodUnion<[zod1930.ZodUnion<[zod1930.ZodString, zod1930.ZodNumber]>, zod1930.ZodBoolean]>>;
|
|
256
|
+
filterOperator: zod1930.ZodOptional<zod1930.ZodEnum<{
|
|
257
257
|
eq: "eq";
|
|
258
258
|
ne: "ne";
|
|
259
259
|
lt: "lt";
|
|
@@ -262,7 +262,7 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
262
262
|
gte: "gte";
|
|
263
263
|
contains: "contains";
|
|
264
264
|
}>>;
|
|
265
|
-
},
|
|
265
|
+
}, zod_v4_core269.$strip>;
|
|
266
266
|
metadata: {
|
|
267
267
|
openapi: {
|
|
268
268
|
operationId: string;
|
|
@@ -303,23 +303,18 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
303
303
|
}, {
|
|
304
304
|
users: UserWithRole[];
|
|
305
305
|
total: number;
|
|
306
|
-
limit: number | undefined;
|
|
307
|
-
offset: number | undefined;
|
|
308
|
-
} | {
|
|
309
|
-
users: never[];
|
|
310
|
-
total: number;
|
|
311
306
|
}>;
|
|
312
|
-
listUserSessions:
|
|
307
|
+
listUserSessions: better_call706.StrictEndpoint<"/admin/list-user-sessions", {
|
|
313
308
|
method: "POST";
|
|
314
|
-
use: ((inputContext:
|
|
309
|
+
use: ((inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<{
|
|
315
310
|
session: {
|
|
316
311
|
user: UserWithRole;
|
|
317
|
-
session:
|
|
312
|
+
session: _better_auth_core_db23.Session;
|
|
318
313
|
};
|
|
319
314
|
}>)[];
|
|
320
|
-
body:
|
|
321
|
-
userId:
|
|
322
|
-
},
|
|
315
|
+
body: zod1930.ZodObject<{
|
|
316
|
+
userId: zod1930.ZodCoercedString<unknown>;
|
|
317
|
+
}, zod_v4_core269.$strip>;
|
|
323
318
|
metadata: {
|
|
324
319
|
openapi: {
|
|
325
320
|
operationId: string;
|
|
@@ -350,15 +345,15 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
350
345
|
}, {
|
|
351
346
|
sessions: SessionWithImpersonatedBy[];
|
|
352
347
|
}>;
|
|
353
|
-
unbanUser:
|
|
348
|
+
unbanUser: better_call706.StrictEndpoint<"/admin/unban-user", {
|
|
354
349
|
method: "POST";
|
|
355
|
-
body:
|
|
356
|
-
userId:
|
|
357
|
-
},
|
|
358
|
-
use: ((inputContext:
|
|
350
|
+
body: zod1930.ZodObject<{
|
|
351
|
+
userId: zod1930.ZodCoercedString<unknown>;
|
|
352
|
+
}, zod_v4_core269.$strip>;
|
|
353
|
+
use: ((inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<{
|
|
359
354
|
session: {
|
|
360
355
|
user: UserWithRole;
|
|
361
|
-
session:
|
|
356
|
+
session: _better_auth_core_db23.Session;
|
|
362
357
|
};
|
|
363
358
|
}>)[];
|
|
364
359
|
metadata: {
|
|
@@ -388,17 +383,17 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
388
383
|
}, {
|
|
389
384
|
user: UserWithRole;
|
|
390
385
|
}>;
|
|
391
|
-
banUser:
|
|
386
|
+
banUser: better_call706.StrictEndpoint<"/admin/ban-user", {
|
|
392
387
|
method: "POST";
|
|
393
|
-
body:
|
|
394
|
-
userId:
|
|
395
|
-
banReason:
|
|
396
|
-
banExpiresIn:
|
|
397
|
-
},
|
|
398
|
-
use: ((inputContext:
|
|
388
|
+
body: zod1930.ZodObject<{
|
|
389
|
+
userId: zod1930.ZodCoercedString<unknown>;
|
|
390
|
+
banReason: zod1930.ZodOptional<zod1930.ZodString>;
|
|
391
|
+
banExpiresIn: zod1930.ZodOptional<zod1930.ZodNumber>;
|
|
392
|
+
}, zod_v4_core269.$strip>;
|
|
393
|
+
use: ((inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<{
|
|
399
394
|
session: {
|
|
400
395
|
user: UserWithRole;
|
|
401
|
-
session:
|
|
396
|
+
session: _better_auth_core_db23.Session;
|
|
402
397
|
};
|
|
403
398
|
}>)[];
|
|
404
399
|
metadata: {
|
|
@@ -428,15 +423,15 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
428
423
|
}, {
|
|
429
424
|
user: UserWithRole;
|
|
430
425
|
}>;
|
|
431
|
-
impersonateUser:
|
|
426
|
+
impersonateUser: better_call706.StrictEndpoint<"/admin/impersonate-user", {
|
|
432
427
|
method: "POST";
|
|
433
|
-
body:
|
|
434
|
-
userId:
|
|
435
|
-
},
|
|
436
|
-
use: ((inputContext:
|
|
428
|
+
body: zod1930.ZodObject<{
|
|
429
|
+
userId: zod1930.ZodCoercedString<unknown>;
|
|
430
|
+
}, zod_v4_core269.$strip>;
|
|
431
|
+
use: ((inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<{
|
|
437
432
|
session: {
|
|
438
433
|
user: UserWithRole;
|
|
439
|
-
session:
|
|
434
|
+
session: _better_auth_core_db23.Session;
|
|
440
435
|
};
|
|
441
436
|
}>)[];
|
|
442
437
|
metadata: {
|
|
@@ -479,7 +474,7 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
479
474
|
};
|
|
480
475
|
user: UserWithRole;
|
|
481
476
|
}>;
|
|
482
|
-
stopImpersonating:
|
|
477
|
+
stopImpersonating: better_call706.StrictEndpoint<"/admin/stop-impersonating", {
|
|
483
478
|
method: "POST";
|
|
484
479
|
requireHeaders: true;
|
|
485
480
|
}, {
|
|
@@ -503,15 +498,15 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
503
498
|
image?: string | null | undefined;
|
|
504
499
|
} & Record<string, any>;
|
|
505
500
|
}>;
|
|
506
|
-
revokeUserSession:
|
|
501
|
+
revokeUserSession: better_call706.StrictEndpoint<"/admin/revoke-user-session", {
|
|
507
502
|
method: "POST";
|
|
508
|
-
body:
|
|
509
|
-
sessionToken:
|
|
510
|
-
},
|
|
511
|
-
use: ((inputContext:
|
|
503
|
+
body: zod1930.ZodObject<{
|
|
504
|
+
sessionToken: zod1930.ZodString;
|
|
505
|
+
}, zod_v4_core269.$strip>;
|
|
506
|
+
use: ((inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<{
|
|
512
507
|
session: {
|
|
513
508
|
user: UserWithRole;
|
|
514
|
-
session:
|
|
509
|
+
session: _better_auth_core_db23.Session;
|
|
515
510
|
};
|
|
516
511
|
}>)[];
|
|
517
512
|
metadata: {
|
|
@@ -541,15 +536,15 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
541
536
|
}, {
|
|
542
537
|
success: boolean;
|
|
543
538
|
}>;
|
|
544
|
-
revokeUserSessions:
|
|
539
|
+
revokeUserSessions: better_call706.StrictEndpoint<"/admin/revoke-user-sessions", {
|
|
545
540
|
method: "POST";
|
|
546
|
-
body:
|
|
547
|
-
userId:
|
|
548
|
-
},
|
|
549
|
-
use: ((inputContext:
|
|
541
|
+
body: zod1930.ZodObject<{
|
|
542
|
+
userId: zod1930.ZodCoercedString<unknown>;
|
|
543
|
+
}, zod_v4_core269.$strip>;
|
|
544
|
+
use: ((inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<{
|
|
550
545
|
session: {
|
|
551
546
|
user: UserWithRole;
|
|
552
|
-
session:
|
|
547
|
+
session: _better_auth_core_db23.Session;
|
|
553
548
|
};
|
|
554
549
|
}>)[];
|
|
555
550
|
metadata: {
|
|
@@ -579,15 +574,15 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
579
574
|
}, {
|
|
580
575
|
success: boolean;
|
|
581
576
|
}>;
|
|
582
|
-
removeUser:
|
|
577
|
+
removeUser: better_call706.StrictEndpoint<"/admin/remove-user", {
|
|
583
578
|
method: "POST";
|
|
584
|
-
body:
|
|
585
|
-
userId:
|
|
586
|
-
},
|
|
587
|
-
use: ((inputContext:
|
|
579
|
+
body: zod1930.ZodObject<{
|
|
580
|
+
userId: zod1930.ZodCoercedString<unknown>;
|
|
581
|
+
}, zod_v4_core269.$strip>;
|
|
582
|
+
use: ((inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<{
|
|
588
583
|
session: {
|
|
589
584
|
user: UserWithRole;
|
|
590
|
-
session:
|
|
585
|
+
session: _better_auth_core_db23.Session;
|
|
591
586
|
};
|
|
592
587
|
}>)[];
|
|
593
588
|
metadata: {
|
|
@@ -617,16 +612,16 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
617
612
|
}, {
|
|
618
613
|
success: boolean;
|
|
619
614
|
}>;
|
|
620
|
-
setUserPassword:
|
|
615
|
+
setUserPassword: better_call706.StrictEndpoint<"/admin/set-user-password", {
|
|
621
616
|
method: "POST";
|
|
622
|
-
body:
|
|
623
|
-
newPassword:
|
|
624
|
-
userId:
|
|
625
|
-
},
|
|
626
|
-
use: ((inputContext:
|
|
617
|
+
body: zod1930.ZodObject<{
|
|
618
|
+
newPassword: zod1930.ZodString;
|
|
619
|
+
userId: zod1930.ZodCoercedString<unknown>;
|
|
620
|
+
}, zod_v4_core269.$strip>;
|
|
621
|
+
use: ((inputContext: better_call706.MiddlewareInputContext<better_call706.MiddlewareOptions>) => Promise<{
|
|
627
622
|
session: {
|
|
628
623
|
user: UserWithRole;
|
|
629
|
-
session:
|
|
624
|
+
session: _better_auth_core_db23.Session;
|
|
630
625
|
};
|
|
631
626
|
}>)[];
|
|
632
627
|
metadata: {
|
|
@@ -656,18 +651,18 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
|
|
|
656
651
|
}, {
|
|
657
652
|
status: boolean;
|
|
658
653
|
}>;
|
|
659
|
-
userHasPermission:
|
|
654
|
+
userHasPermission: better_call706.StrictEndpoint<"/admin/has-permission", {
|
|
660
655
|
method: "POST";
|
|
661
|
-
body:
|
|
662
|
-
userId:
|
|
663
|
-
role:
|
|
664
|
-
},
|
|
665
|
-
permission:
|
|
666
|
-
permissions:
|
|
667
|
-
},
|
|
668
|
-
permission:
|
|
669
|
-
permissions:
|
|
670
|
-
},
|
|
656
|
+
body: zod1930.ZodIntersection<zod1930.ZodObject<{
|
|
657
|
+
userId: zod1930.ZodOptional<zod1930.ZodCoercedString<unknown>>;
|
|
658
|
+
role: zod1930.ZodOptional<zod1930.ZodString>;
|
|
659
|
+
}, zod_v4_core269.$strip>, zod1930.ZodUnion<readonly [zod1930.ZodObject<{
|
|
660
|
+
permission: zod1930.ZodRecord<zod1930.ZodString, zod1930.ZodArray<zod1930.ZodString>>;
|
|
661
|
+
permissions: zod1930.ZodUndefined;
|
|
662
|
+
}, zod_v4_core269.$strip>, zod1930.ZodObject<{
|
|
663
|
+
permission: zod1930.ZodUndefined;
|
|
664
|
+
permissions: zod1930.ZodRecord<zod1930.ZodString, zod1930.ZodArray<zod1930.ZodString>>;
|
|
665
|
+
}, zod_v4_core269.$strip>]>>;
|
|
671
666
|
metadata: {
|
|
672
667
|
openapi: {
|
|
673
668
|
description: string;
|
|
@@ -34,7 +34,7 @@ const admin = (options) => {
|
|
|
34
34
|
session: { create: { async before(session, ctx) {
|
|
35
35
|
if (!ctx) return;
|
|
36
36
|
const user = await ctx.context.internalAdapter.findUserById(session.userId);
|
|
37
|
-
if (user
|
|
37
|
+
if (user?.banned) {
|
|
38
38
|
if (user.banExpires && new Date(user.banExpires).getTime() < Date.now()) {
|
|
39
39
|
await ctx.context.internalAdapter.updateUser(session.userId, {
|
|
40
40
|
banned: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.mjs","names":[],"sources":["../../../src/plugins/admin/admin.ts"],"sourcesContent":["import type { BetterAuthPlugin } from \"@better-auth/core\";\nimport { createAuthMiddleware } from \"@better-auth/core/api\";\nimport { BetterAuthError } from \"@better-auth/core/error\";\nimport { APIError } from \"../../api\";\nimport { mergeSchema } from \"../../db/schema\";\nimport { getEndpointResponse } from \"../../utils/plugin-helper\";\nimport { defaultRoles } from \"./access\";\nimport { ADMIN_ERROR_CODES } from \"./error-codes\";\nimport {\n\tadminUpdateUser,\n\tbanUser,\n\tcreateUser,\n\tgetUser,\n\timpersonateUser,\n\tlistUserSessions,\n\tlistUsers,\n\tremoveUser,\n\trevokeUserSession,\n\trevokeUserSessions,\n\tsetRole,\n\tsetUserPassword,\n\tstopImpersonating,\n\tunbanUser,\n\tuserHasPermission,\n} from \"./routes\";\nimport { schema } from \"./schema\";\nimport type {\n\tAdminOptions,\n\tSessionWithImpersonatedBy,\n\tUserWithRole,\n} from \"./types\";\n\nexport const admin = <O extends AdminOptions>(options?: O | undefined) => {\n\tconst opts = {\n\t\t...(options || {}),\n\t\tdefaultRole: options?.defaultRole ?? \"user\",\n\t\tadminRoles: options?.adminRoles ?? [\"admin\"],\n\t\tbannedUserMessage:\n\t\t\toptions?.bannedUserMessage ??\n\t\t\t\"You have been banned from this application. Please contact support if you believe this is an error.\",\n\t} as O &\n\t\tRequired<\n\t\t\tPick<AdminOptions, \"defaultRole\" | \"adminRoles\" | \"bannedUserMessage\">\n\t\t>;\n\n\tif (options?.adminRoles) {\n\t\tconst adminRoles = Array.isArray(options.adminRoles)\n\t\t\t? options.adminRoles\n\t\t\t: [...options.adminRoles.split(\",\")];\n\t\tconst invalidRoles = adminRoles.filter(\n\t\t\t(role) =>\n\t\t\t\t!Object.keys(options?.roles || defaultRoles)\n\t\t\t\t\t.map((r) => r.toLowerCase())\n\t\t\t\t\t.includes(role.toLowerCase()),\n\t\t);\n\t\tif (invalidRoles.length > 0) {\n\t\t\tthrow new BetterAuthError(\n\t\t\t\t`Invalid admin roles: ${invalidRoles.join(\", \")}. Admin roles must be defined in the 'roles' configuration.`,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn {\n\t\tid: \"admin\",\n\t\tinit() {\n\t\t\treturn {\n\t\t\t\toptions: {\n\t\t\t\t\tdatabaseHooks: {\n\t\t\t\t\t\tuser: {\n\t\t\t\t\t\t\tcreate: {\n\t\t\t\t\t\t\t\tasync before(user) {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\t\trole: options?.defaultRole ?? \"user\",\n\t\t\t\t\t\t\t\t\t\t\t...user,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsession: {\n\t\t\t\t\t\t\tcreate: {\n\t\t\t\t\t\t\t\tasync before(session, ctx) {\n\t\t\t\t\t\t\t\t\tif (!ctx) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tconst user = (await ctx.context.internalAdapter.findUserById(\n\t\t\t\t\t\t\t\t\t\tsession.userId,\n\t\t\t\t\t\t\t\t\t)) as UserWithRole;\n\n\t\t\t\t\t\t\t\t\tif (user
|
|
1
|
+
{"version":3,"file":"admin.mjs","names":[],"sources":["../../../src/plugins/admin/admin.ts"],"sourcesContent":["import type { BetterAuthPlugin } from \"@better-auth/core\";\nimport { createAuthMiddleware } from \"@better-auth/core/api\";\nimport { BetterAuthError } from \"@better-auth/core/error\";\nimport { APIError } from \"../../api\";\nimport { mergeSchema } from \"../../db/schema\";\nimport { getEndpointResponse } from \"../../utils/plugin-helper\";\nimport { defaultRoles } from \"./access\";\nimport { ADMIN_ERROR_CODES } from \"./error-codes\";\nimport {\n\tadminUpdateUser,\n\tbanUser,\n\tcreateUser,\n\tgetUser,\n\timpersonateUser,\n\tlistUserSessions,\n\tlistUsers,\n\tremoveUser,\n\trevokeUserSession,\n\trevokeUserSessions,\n\tsetRole,\n\tsetUserPassword,\n\tstopImpersonating,\n\tunbanUser,\n\tuserHasPermission,\n} from \"./routes\";\nimport { schema } from \"./schema\";\nimport type {\n\tAdminOptions,\n\tSessionWithImpersonatedBy,\n\tUserWithRole,\n} from \"./types\";\n\nexport const admin = <O extends AdminOptions>(options?: O | undefined) => {\n\tconst opts = {\n\t\t...(options || {}),\n\t\tdefaultRole: options?.defaultRole ?? \"user\",\n\t\tadminRoles: options?.adminRoles ?? [\"admin\"],\n\t\tbannedUserMessage:\n\t\t\toptions?.bannedUserMessage ??\n\t\t\t\"You have been banned from this application. Please contact support if you believe this is an error.\",\n\t} as O &\n\t\tRequired<\n\t\t\tPick<AdminOptions, \"defaultRole\" | \"adminRoles\" | \"bannedUserMessage\">\n\t\t>;\n\n\tif (options?.adminRoles) {\n\t\tconst adminRoles = Array.isArray(options.adminRoles)\n\t\t\t? options.adminRoles\n\t\t\t: [...options.adminRoles.split(\",\")];\n\t\tconst invalidRoles = adminRoles.filter(\n\t\t\t(role) =>\n\t\t\t\t!Object.keys(options?.roles || defaultRoles)\n\t\t\t\t\t.map((r) => r.toLowerCase())\n\t\t\t\t\t.includes(role.toLowerCase()),\n\t\t);\n\t\tif (invalidRoles.length > 0) {\n\t\t\tthrow new BetterAuthError(\n\t\t\t\t`Invalid admin roles: ${invalidRoles.join(\", \")}. Admin roles must be defined in the 'roles' configuration.`,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn {\n\t\tid: \"admin\",\n\t\tinit() {\n\t\t\treturn {\n\t\t\t\toptions: {\n\t\t\t\t\tdatabaseHooks: {\n\t\t\t\t\t\tuser: {\n\t\t\t\t\t\t\tcreate: {\n\t\t\t\t\t\t\t\tasync before(user) {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\t\trole: options?.defaultRole ?? \"user\",\n\t\t\t\t\t\t\t\t\t\t\t...user,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsession: {\n\t\t\t\t\t\t\tcreate: {\n\t\t\t\t\t\t\t\tasync before(session, ctx) {\n\t\t\t\t\t\t\t\t\tif (!ctx) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tconst user = (await ctx.context.internalAdapter.findUserById(\n\t\t\t\t\t\t\t\t\t\tsession.userId,\n\t\t\t\t\t\t\t\t\t)) as UserWithRole | null;\n\n\t\t\t\t\t\t\t\t\tif (user?.banned) {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tuser.banExpires &&\n\t\t\t\t\t\t\t\t\t\t\tnew Date(user.banExpires).getTime() < Date.now()\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tawait ctx.context.internalAdapter.updateUser(\n\t\t\t\t\t\t\t\t\t\t\t\tsession.userId,\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tbanned: false,\n\t\t\t\t\t\t\t\t\t\t\t\t\tbanReason: null,\n\t\t\t\t\t\t\t\t\t\t\t\t\tbanExpires: null,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tctx &&\n\t\t\t\t\t\t\t\t\t\t\t(ctx.path.startsWith(\"/callback\") ||\n\t\t\t\t\t\t\t\t\t\t\t\tctx.path.startsWith(\"/oauth2/callback\"))\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tconst redirectURI =\n\t\t\t\t\t\t\t\t\t\t\t\tctx.context.options.onAPIError?.errorURL ||\n\t\t\t\t\t\t\t\t\t\t\t\t`${ctx.context.baseURL}/error`;\n\t\t\t\t\t\t\t\t\t\t\tthrow ctx.redirect(\n\t\t\t\t\t\t\t\t\t\t\t\t`${redirectURI}?error=banned&error_description=${opts.bannedUserMessage}`,\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tthrow new APIError(\"FORBIDDEN\", {\n\t\t\t\t\t\t\t\t\t\t\tmessage: opts.bannedUserMessage,\n\t\t\t\t\t\t\t\t\t\t\tcode: \"BANNED_USER\",\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\thooks: {\n\t\t\tafter: [\n\t\t\t\t{\n\t\t\t\t\tmatcher(context) {\n\t\t\t\t\t\treturn context.path === \"/list-sessions\";\n\t\t\t\t\t},\n\t\t\t\t\thandler: createAuthMiddleware(async (ctx) => {\n\t\t\t\t\t\tconst response =\n\t\t\t\t\t\t\tawait getEndpointResponse<SessionWithImpersonatedBy[]>(ctx);\n\n\t\t\t\t\t\tif (!response) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst newJson = response.filter((session) => {\n\t\t\t\t\t\t\treturn !session.impersonatedBy;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn ctx.json(newJson);\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tendpoints: {\n\t\t\tsetRole: setRole(opts),\n\t\t\tgetUser: getUser(opts),\n\t\t\tcreateUser: createUser(opts),\n\t\t\tadminUpdateUser: adminUpdateUser(opts),\n\t\t\tlistUsers: listUsers(opts),\n\t\t\tlistUserSessions: listUserSessions(opts),\n\t\t\tunbanUser: unbanUser(opts),\n\t\t\tbanUser: banUser(opts),\n\t\t\timpersonateUser: impersonateUser(opts),\n\t\t\tstopImpersonating: stopImpersonating(),\n\t\t\trevokeUserSession: revokeUserSession(opts),\n\t\t\trevokeUserSessions: revokeUserSessions(opts),\n\t\t\tremoveUser: removeUser(opts),\n\t\t\tsetUserPassword: setUserPassword(opts),\n\t\t\tuserHasPermission: userHasPermission(opts as O),\n\t\t},\n\t\t$ERROR_CODES: ADMIN_ERROR_CODES,\n\t\tschema: mergeSchema(schema, opts.schema),\n\t\toptions: options as NoInfer<O>,\n\t} satisfies BetterAuthPlugin;\n};\n"],"mappings":";;;;;;;;;;;;AAgCA,MAAa,SAAiC,YAA4B;CACzE,MAAM,OAAO;EACZ,GAAI,WAAW,EAAE;EACjB,aAAa,SAAS,eAAe;EACrC,YAAY,SAAS,cAAc,CAAC,QAAQ;EAC5C,mBACC,SAAS,qBACT;EACD;AAKD,KAAI,SAAS,YAAY;EAIxB,MAAM,gBAHa,MAAM,QAAQ,QAAQ,WAAW,GACjD,QAAQ,aACR,CAAC,GAAG,QAAQ,WAAW,MAAM,IAAI,CAAC,EACL,QAC9B,SACA,CAAC,OAAO,KAAK,SAAS,SAAS,aAAa,CAC1C,KAAK,MAAM,EAAE,aAAa,CAAC,CAC3B,SAAS,KAAK,aAAa,CAAC,CAC/B;AACD,MAAI,aAAa,SAAS,EACzB,OAAM,IAAI,gBACT,wBAAwB,aAAa,KAAK,KAAK,CAAC,6DAChD;;AAIH,QAAO;EACN,IAAI;EACJ,OAAO;AACN,UAAO,EACN,SAAS,EACR,eAAe;IACd,MAAM,EACL,QAAQ,EACP,MAAM,OAAO,MAAM;AAClB,YAAO,EACN,MAAM;MACL,MAAM,SAAS,eAAe;MAC9B,GAAG;MACH,EACD;OAEF,EACD;IACD,SAAS,EACR,QAAQ,EACP,MAAM,OAAO,SAAS,KAAK;AAC1B,SAAI,CAAC,IACJ;KAED,MAAM,OAAQ,MAAM,IAAI,QAAQ,gBAAgB,aAC/C,QAAQ,OACR;AAED,SAAI,MAAM,QAAQ;AACjB,UACC,KAAK,cACL,IAAI,KAAK,KAAK,WAAW,CAAC,SAAS,GAAG,KAAK,KAAK,EAC/C;AACD,aAAM,IAAI,QAAQ,gBAAgB,WACjC,QAAQ,QACR;QACC,QAAQ;QACR,WAAW;QACX,YAAY;QACZ,CACD;AACD;;AAGD,UACC,QACC,IAAI,KAAK,WAAW,YAAY,IAChC,IAAI,KAAK,WAAW,mBAAmB,GACvC;OACD,MAAM,cACL,IAAI,QAAQ,QAAQ,YAAY,YAChC,GAAG,IAAI,QAAQ,QAAQ;AACxB,aAAM,IAAI,SACT,GAAG,YAAY,kCAAkC,KAAK,oBACtD;;AAGF,YAAM,IAAI,SAAS,aAAa;OAC/B,SAAS,KAAK;OACd,MAAM;OACN,CAAC;;OAGJ,EACD;IACD,EACD,EACD;;EAEF,OAAO,EACN,OAAO,CACN;GACC,QAAQ,SAAS;AAChB,WAAO,QAAQ,SAAS;;GAEzB,SAAS,qBAAqB,OAAO,QAAQ;IAC5C,MAAM,WACL,MAAM,oBAAiD,IAAI;AAE5D,QAAI,CAAC,SACJ;IAED,MAAM,UAAU,SAAS,QAAQ,YAAY;AAC5C,YAAO,CAAC,QAAQ;MACf;AAEF,WAAO,IAAI,KAAK,QAAQ;KACvB;GACF,CACD,EACD;EACD,WAAW;GACV,SAAS,QAAQ,KAAK;GACtB,SAAS,QAAQ,KAAK;GACtB,YAAY,WAAW,KAAK;GAC5B,iBAAiB,gBAAgB,KAAK;GACtC,WAAW,UAAU,KAAK;GAC1B,kBAAkB,iBAAiB,KAAK;GACxC,WAAW,UAAU,KAAK;GAC1B,SAAS,QAAQ,KAAK;GACtB,iBAAiB,gBAAgB,KAAK;GACtC,mBAAmB,mBAAmB;GACtC,mBAAmB,kBAAkB,KAAK;GAC1C,oBAAoB,mBAAmB,KAAK;GAC5C,YAAY,WAAW,KAAK;GAC5B,iBAAiB,gBAAgB,KAAK;GACtC,mBAAmB,kBAAkB,KAAU;GAC/C;EACD,cAAc;EACd,QAAQ,YAAY,QAAQ,KAAK,OAAO;EAC/B;EACT"}
|
|
@@ -307,7 +307,7 @@ const listUsers = (opts) => createAuthEndpoint("/admin/list-users", {
|
|
|
307
307
|
operator: ctx.query.searchOperator || "contains",
|
|
308
308
|
value: ctx.query.searchValue
|
|
309
309
|
});
|
|
310
|
-
if (ctx.query?.filterValue) where.push({
|
|
310
|
+
if (ctx.query?.filterValue !== void 0) where.push({
|
|
311
311
|
field: ctx.query.filterField || "email",
|
|
312
312
|
operator: ctx.query.filterOperator || "eq",
|
|
313
313
|
value: ctx.query.filterValue
|