@dads-framework/identity-better-auth 0.1.0 → 0.2.0

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.
Files changed (63) hide show
  1. package/README.md +214 -16
  2. package/dist/identity-better-auth.tsbuildinfo +1 -1
  3. package/dist/impersonation-store/index.d.ts +3 -0
  4. package/dist/impersonation-store/index.d.ts.map +1 -0
  5. package/dist/impersonation-store/index.js +3 -0
  6. package/dist/impersonation-store/index.js.map +1 -0
  7. package/dist/impersonation-store/postgres-impersonation-store.d.ts +4 -0
  8. package/dist/impersonation-store/postgres-impersonation-store.d.ts.map +1 -0
  9. package/dist/impersonation-store/postgres-impersonation-store.js +75 -0
  10. package/dist/impersonation-store/postgres-impersonation-store.js.map +1 -0
  11. package/dist/index.d.ts +6 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +5 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/lib/configure-better-auth.d.ts +1226 -5
  16. package/dist/lib/configure-better-auth.d.ts.map +1 -1
  17. package/dist/lib/configure-better-auth.js +21 -3
  18. package/dist/lib/configure-better-auth.js.map +1 -1
  19. package/dist/lib/create-better-auth-identity.d.ts +4 -0
  20. package/dist/lib/create-better-auth-identity.d.ts.map +1 -1
  21. package/dist/lib/create-better-auth-identity.js +22 -16
  22. package/dist/lib/create-better-auth-identity.js.map +1 -1
  23. package/dist/lib/enterprise-callback-context.d.ts +9 -0
  24. package/dist/lib/enterprise-callback-context.d.ts.map +1 -0
  25. package/dist/lib/enterprise-callback-context.js +9 -0
  26. package/dist/lib/enterprise-callback-context.js.map +1 -0
  27. package/dist/lib/enterprise-options.d.ts +31 -0
  28. package/dist/lib/enterprise-options.d.ts.map +1 -0
  29. package/dist/lib/enterprise-options.js +119 -0
  30. package/dist/lib/enterprise-options.js.map +1 -0
  31. package/dist/lib/enterprise-plugin.d.ts +1038 -0
  32. package/dist/lib/enterprise-plugin.d.ts.map +1 -0
  33. package/dist/lib/enterprise-plugin.js +211 -0
  34. package/dist/lib/enterprise-plugin.js.map +1 -0
  35. package/dist/lib/enterprise-routes.d.ts +5 -0
  36. package/dist/lib/enterprise-routes.d.ts.map +1 -0
  37. package/dist/lib/enterprise-routes.js +215 -0
  38. package/dist/lib/enterprise-routes.js.map +1 -0
  39. package/dist/lib/identity-handler.d.ts +2 -1
  40. package/dist/lib/identity-handler.d.ts.map +1 -1
  41. package/dist/lib/identity-handler.js +25 -5
  42. package/dist/lib/identity-handler.js.map +1 -1
  43. package/dist/lib/identity-session-readers.d.ts +23 -0
  44. package/dist/lib/identity-session-readers.d.ts.map +1 -0
  45. package/dist/lib/identity-session-readers.js +81 -0
  46. package/dist/lib/identity-session-readers.js.map +1 -0
  47. package/dist/lib/install-identity-schema-v2.d.ts +4 -0
  48. package/dist/lib/install-identity-schema-v2.d.ts.map +1 -0
  49. package/dist/lib/install-identity-schema-v2.js +8 -0
  50. package/dist/lib/install-identity-schema-v2.js.map +1 -0
  51. package/dist/lib/migrations/20261120070530_identity_jwks.migration.d.ts +5 -0
  52. package/dist/lib/migrations/20261120070530_identity_jwks.migration.d.ts.map +1 -0
  53. package/dist/lib/migrations/20261120070530_identity_jwks.migration.js +10 -0
  54. package/dist/lib/migrations/20261120070530_identity_jwks.migration.js.map +1 -0
  55. package/dist/lib/migrations/20261120070600_enterprise_sso.migration.d.ts +5 -0
  56. package/dist/lib/migrations/20261120070600_enterprise_sso.migration.d.ts.map +1 -0
  57. package/dist/lib/migrations/20261120070600_enterprise_sso.migration.js +33 -0
  58. package/dist/lib/migrations/20261120070600_enterprise_sso.migration.js.map +1 -0
  59. package/dist/lib/migrations/20261120070700_staff_impersonation.migration.d.ts +6 -0
  60. package/dist/lib/migrations/20261120070700_staff_impersonation.migration.d.ts.map +1 -0
  61. package/dist/lib/migrations/20261120070700_staff_impersonation.migration.js +37 -0
  62. package/dist/lib/migrations/20261120070700_staff_impersonation.migration.js.map +1 -0
  63. package/package.json +12 -5
@@ -1,7 +1,8 @@
1
1
  import type { IdentityEmail } from "@dads-framework/identity";
2
2
  import { PostgresDialect } from "kysely";
3
3
  import { type BetterAuthIdentityOptions } from "./identity-options.js";
4
- export declare function configureBetterAuth(options: BetterAuthIdentityOptions, origin: string, sendEmail: (email: IdentityEmail) => void): import("better-auth").Auth<{
4
+ import type { EnterpriseSsoProvider } from "./enterprise-options.js";
5
+ export declare function configureBetterAuth(options: BetterAuthIdentityOptions, origin: string, sendEmail: (email: IdentityEmail) => void, providers?: readonly EnterpriseSsoProvider[]): import("better-auth").Auth<{
5
6
  baseURL: string;
6
7
  basePath: string;
7
8
  secret: string;
@@ -15,6 +16,168 @@ export declare function configureBetterAuth(options: BetterAuthIdentityOptions,
15
16
  };
16
17
  account: {
17
18
  modelName: "identity_credentials";
19
+ updateAccountOnSignIn?: false;
20
+ additionalFields?: {
21
+ ssoProviderBinding: {
22
+ type: "string";
23
+ required: false;
24
+ input: false;
25
+ };
26
+ };
27
+ };
28
+ databaseHooks?: {
29
+ user?: {
30
+ create?: {
31
+ before?: (user: import("better-auth").User & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<boolean | void | {
32
+ data: {
33
+ id?: string | undefined;
34
+ createdAt?: Date | undefined;
35
+ updatedAt?: Date | undefined;
36
+ email?: string | undefined;
37
+ emailVerified?: boolean | undefined;
38
+ name?: string | undefined;
39
+ image?: string | null | undefined;
40
+ } & Record<string, any>;
41
+ }>;
42
+ after?: (user: import("better-auth").User & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
43
+ };
44
+ update?: {
45
+ before?: (user: Partial<import("better-auth").User> & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<boolean | void | {
46
+ data: {
47
+ [x: string]: any;
48
+ id?: string | undefined;
49
+ createdAt?: Date | undefined;
50
+ updatedAt?: Date | undefined;
51
+ email?: string | undefined;
52
+ emailVerified?: boolean | undefined;
53
+ name?: string | undefined;
54
+ image?: string | null | undefined;
55
+ };
56
+ }>;
57
+ after?: (user: import("better-auth").User & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
58
+ };
59
+ delete?: {
60
+ before?: (user: import("better-auth").User & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<boolean | void>;
61
+ after?: (user: import("better-auth").User & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
62
+ };
63
+ };
64
+ session?: {
65
+ create?: {
66
+ before?: (session: import("better-auth").Session & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<boolean | void | {
67
+ data: {
68
+ id?: string | undefined;
69
+ createdAt?: Date | undefined;
70
+ updatedAt?: Date | undefined;
71
+ userId?: string | undefined;
72
+ expiresAt?: Date | undefined;
73
+ token?: string | undefined;
74
+ ipAddress?: string | null | undefined;
75
+ userAgent?: string | null | undefined;
76
+ } & Record<string, any>;
77
+ }>;
78
+ after?: (session: import("better-auth").Session & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
79
+ };
80
+ update?: {
81
+ before?: (session: Partial<import("better-auth").Session> & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<boolean | void | {
82
+ data: {
83
+ [x: string]: any;
84
+ id?: string | undefined;
85
+ createdAt?: Date | undefined;
86
+ updatedAt?: Date | undefined;
87
+ userId?: string | undefined;
88
+ expiresAt?: Date | undefined;
89
+ token?: string | undefined;
90
+ ipAddress?: string | null | undefined;
91
+ userAgent?: string | null | undefined;
92
+ };
93
+ }>;
94
+ after?: (session: import("better-auth").Session & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
95
+ };
96
+ delete?: {
97
+ before?: (session: import("better-auth").Session & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<boolean | void>;
98
+ after?: (session: import("better-auth").Session & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
99
+ };
100
+ };
101
+ account?: {
102
+ create?: {
103
+ before?: (account: import("better-auth").Account, context: import("better-auth").GenericEndpointContext | null) => Promise<boolean | void | {
104
+ data: {
105
+ id?: string | undefined;
106
+ createdAt?: Date | undefined;
107
+ updatedAt?: Date | undefined;
108
+ providerId?: string | undefined;
109
+ accountId?: string | undefined;
110
+ userId?: string | undefined;
111
+ accessToken?: string | null | undefined;
112
+ refreshToken?: string | null | undefined;
113
+ idToken?: string | null | undefined;
114
+ accessTokenExpiresAt?: Date | null | undefined;
115
+ refreshTokenExpiresAt?: Date | null | undefined;
116
+ scope?: string | null | undefined;
117
+ password?: string | null | undefined;
118
+ } & Record<string, any>;
119
+ }>;
120
+ after?: (account: import("better-auth").Account, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
121
+ };
122
+ update?: {
123
+ before?: (account: Partial<import("better-auth").Account> & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<boolean | void | {
124
+ data: {
125
+ [x: string]: any;
126
+ id?: string | undefined;
127
+ createdAt?: Date | undefined;
128
+ updatedAt?: Date | undefined;
129
+ providerId?: string | undefined;
130
+ accountId?: string | undefined;
131
+ userId?: string | undefined;
132
+ accessToken?: string | null | undefined;
133
+ refreshToken?: string | null | undefined;
134
+ idToken?: string | null | undefined;
135
+ accessTokenExpiresAt?: Date | null | undefined;
136
+ refreshTokenExpiresAt?: Date | null | undefined;
137
+ scope?: string | null | undefined;
138
+ password?: string | null | undefined;
139
+ };
140
+ }>;
141
+ after?: (account: import("better-auth").Account & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
142
+ };
143
+ delete?: {
144
+ before?: (account: import("better-auth").Account & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<boolean | void>;
145
+ after?: (account: import("better-auth").Account & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
146
+ };
147
+ };
148
+ verification?: {
149
+ create?: {
150
+ before?: (verification: import("better-auth").Verification & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<boolean | void | {
151
+ data: {
152
+ id?: string | undefined;
153
+ createdAt?: Date | undefined;
154
+ updatedAt?: Date | undefined;
155
+ value?: string | undefined;
156
+ expiresAt?: Date | undefined;
157
+ identifier?: string | undefined;
158
+ } & Record<string, any>;
159
+ }>;
160
+ after?: (verification: import("better-auth").Verification & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
161
+ };
162
+ update?: {
163
+ before?: (verification: Partial<import("better-auth").Verification> & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<boolean | void | {
164
+ data: {
165
+ [x: string]: any;
166
+ id?: string | undefined;
167
+ createdAt?: Date | undefined;
168
+ updatedAt?: Date | undefined;
169
+ value?: string | undefined;
170
+ expiresAt?: Date | undefined;
171
+ identifier?: string | undefined;
172
+ };
173
+ }>;
174
+ after?: (verification: import("better-auth").Verification & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
175
+ };
176
+ delete?: {
177
+ before?: (verification: import("better-auth").Verification & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<boolean | void>;
178
+ after?: (verification: import("better-auth").Verification & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>;
179
+ };
180
+ };
18
181
  };
19
182
  verification: {
20
183
  modelName: "identity_verifications";
@@ -28,6 +191,13 @@ export declare function configureBetterAuth(options: BetterAuthIdentityOptions,
28
191
  cookieCache: {
29
192
  enabled: false;
30
193
  };
194
+ additionalFields?: {
195
+ ssoProviderBinding: {
196
+ type: "string";
197
+ required: false;
198
+ input: false;
199
+ };
200
+ };
31
201
  };
32
202
  emailAndPassword: {
33
203
  enabled: true;
@@ -61,7 +231,1036 @@ export declare function configureBetterAuth(options: BetterAuthIdentityOptions,
61
231
  logger: {
62
232
  disabled: true;
63
233
  };
64
- plugins: [{
234
+ plugins: [...{
235
+ id: "sso";
236
+ version: string;
237
+ endpoints: {
238
+ spMetadata: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/saml2/sp/metadata", {
239
+ method: "GET";
240
+ query: import("better-auth").ZodObject<{
241
+ providerId: import("better-auth").ZodString;
242
+ }, import("zod/v4/core").$strip>;
243
+ metadata: {
244
+ openapi: {
245
+ operationId: string;
246
+ summary: string;
247
+ description: string;
248
+ responses: {
249
+ "200": {
250
+ description: string;
251
+ };
252
+ };
253
+ };
254
+ };
255
+ }, Response>>;
256
+ registerSSOProvider: import("better-auth").StrictEndpoint<"/sso/register", {
257
+ method: "POST";
258
+ body: import("better-auth").ZodObject<{
259
+ [x: string]: import("better-auth").ZodOptional<import("better-auth").ZodAny>;
260
+ }, import("zod/v4/core").$strip>;
261
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
262
+ session: {
263
+ session: Record<string, any> & {
264
+ id: string;
265
+ createdAt: Date;
266
+ updatedAt: Date;
267
+ userId: string;
268
+ expiresAt: Date;
269
+ token: string;
270
+ ipAddress?: string | null | undefined;
271
+ userAgent?: string | null | undefined;
272
+ };
273
+ user: Record<string, any> & {
274
+ id: string;
275
+ createdAt: Date;
276
+ updatedAt: Date;
277
+ email: string;
278
+ emailVerified: boolean;
279
+ name: string;
280
+ image?: string | null | undefined;
281
+ };
282
+ };
283
+ }>>[];
284
+ metadata: {
285
+ $Infer: {
286
+ body: {
287
+ [x: string]: any;
288
+ };
289
+ };
290
+ openapi: {
291
+ operationId: string;
292
+ summary: string;
293
+ description: string;
294
+ responses: {
295
+ "200": {
296
+ description: string;
297
+ content: {
298
+ "application/json": {
299
+ schema: {
300
+ type: "object";
301
+ properties: {
302
+ issuer: {
303
+ type: string;
304
+ format: string;
305
+ description: string;
306
+ };
307
+ domain: {
308
+ type: string;
309
+ description: string;
310
+ };
311
+ domainVerified: {
312
+ type: string;
313
+ description: string;
314
+ };
315
+ domainVerificationToken: {
316
+ type: string;
317
+ description: string;
318
+ };
319
+ oidcConfig: {
320
+ type: string;
321
+ properties: {
322
+ issuer: {
323
+ type: string;
324
+ format: string;
325
+ description: string;
326
+ };
327
+ pkce: {
328
+ type: string;
329
+ description: string;
330
+ };
331
+ clientId: {
332
+ type: string;
333
+ description: string;
334
+ };
335
+ clientSecret: {
336
+ type: string;
337
+ description: string;
338
+ };
339
+ authorizationEndpoint: {
340
+ type: string;
341
+ format: string;
342
+ nullable: boolean;
343
+ description: string;
344
+ };
345
+ discoveryEndpoint: {
346
+ type: string;
347
+ format: string;
348
+ description: string;
349
+ };
350
+ userInfoEndpoint: {
351
+ type: string;
352
+ format: string;
353
+ nullable: boolean;
354
+ description: string;
355
+ };
356
+ scopes: {
357
+ type: string;
358
+ items: {
359
+ type: string;
360
+ };
361
+ nullable: boolean;
362
+ description: string;
363
+ };
364
+ tokenEndpoint: {
365
+ type: string;
366
+ format: string;
367
+ nullable: boolean;
368
+ description: string;
369
+ };
370
+ tokenEndpointAuthentication: {
371
+ type: string;
372
+ enum: string[];
373
+ nullable: boolean;
374
+ description: string;
375
+ };
376
+ jwksEndpoint: {
377
+ type: string;
378
+ format: string;
379
+ nullable: boolean;
380
+ description: string;
381
+ };
382
+ mapping: {
383
+ type: string;
384
+ nullable: boolean;
385
+ properties: {
386
+ email: {
387
+ type: string;
388
+ description: string;
389
+ };
390
+ emailVerified: {
391
+ type: string;
392
+ nullable: boolean;
393
+ description: string;
394
+ };
395
+ name: {
396
+ type: string;
397
+ description: string;
398
+ };
399
+ image: {
400
+ type: string;
401
+ nullable: boolean;
402
+ description: string;
403
+ };
404
+ extraFields: {
405
+ type: string;
406
+ additionalProperties: {
407
+ type: string;
408
+ };
409
+ nullable: boolean;
410
+ description: string;
411
+ };
412
+ };
413
+ };
414
+ };
415
+ required: string[];
416
+ description: string;
417
+ };
418
+ organizationId: {
419
+ type: string;
420
+ nullable: boolean;
421
+ description: string;
422
+ };
423
+ userId: {
424
+ type: string;
425
+ description: string;
426
+ };
427
+ providerId: {
428
+ type: string;
429
+ description: string;
430
+ };
431
+ redirectURI: {
432
+ type: string;
433
+ format: string;
434
+ description: string;
435
+ };
436
+ };
437
+ required: string[];
438
+ };
439
+ };
440
+ };
441
+ };
442
+ };
443
+ };
444
+ };
445
+ }, {
446
+ redirectURI: string;
447
+ oidcConfig: import("@better-auth/sso").OIDCConfig | null;
448
+ samlConfig: import("@better-auth/sso").SAMLConfig | null;
449
+ } & Omit<{
450
+ domainVerified: boolean;
451
+ } & {
452
+ issuer: string;
453
+ oidcConfig?: import("@better-auth/sso").OIDCConfig | undefined;
454
+ samlConfig?: import("@better-auth/sso").SAMLConfig | undefined;
455
+ userId: string;
456
+ providerId: string;
457
+ organizationId?: string | undefined;
458
+ domain: string;
459
+ }, "oidcConfig" | "samlConfig"> & {
460
+ domainVerified: boolean;
461
+ domainVerificationToken: string;
462
+ }>;
463
+ signInSSO: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sign-in/sso", {
464
+ method: "POST";
465
+ body: import("better-auth").ZodObject<{
466
+ email: import("better-auth").ZodOptional<import("better-auth").ZodString>;
467
+ organizationSlug: import("better-auth").ZodOptional<import("better-auth").ZodString>;
468
+ providerId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
469
+ domain: import("better-auth").ZodOptional<import("better-auth").ZodString>;
470
+ callbackURL: import("better-auth").ZodString;
471
+ errorCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
472
+ newUserCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
473
+ scopes: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>;
474
+ loginHint: import("better-auth").ZodOptional<import("better-auth").ZodString>;
475
+ additionalParams: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodString>>;
476
+ requestSignUp: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
477
+ providerType: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
478
+ saml: "saml";
479
+ oidc: "oidc";
480
+ }>>;
481
+ }, import("zod/v4/core").$strip>;
482
+ metadata: {
483
+ openapi: {
484
+ operationId: string;
485
+ summary: string;
486
+ description: string;
487
+ requestBody: {
488
+ content: {
489
+ "application/json": {
490
+ schema: {
491
+ type: "object";
492
+ properties: {
493
+ email: {
494
+ type: string;
495
+ description: string;
496
+ };
497
+ organizationSlug: {
498
+ type: string;
499
+ description: string;
500
+ };
501
+ providerId: {
502
+ type: string;
503
+ description: string;
504
+ };
505
+ domain: {
506
+ type: string;
507
+ description: string;
508
+ };
509
+ callbackURL: {
510
+ type: string;
511
+ description: string;
512
+ };
513
+ errorCallbackURL: {
514
+ type: string;
515
+ description: string;
516
+ };
517
+ newUserCallbackURL: {
518
+ type: string;
519
+ description: string;
520
+ };
521
+ scopes: {
522
+ type: string;
523
+ items: {
524
+ type: string;
525
+ };
526
+ description: string;
527
+ };
528
+ loginHint: {
529
+ type: string;
530
+ description: string;
531
+ };
532
+ additionalParams: {
533
+ type: string;
534
+ additionalProperties: {
535
+ type: string;
536
+ };
537
+ description: string;
538
+ };
539
+ requestSignUp: {
540
+ type: string;
541
+ description: string;
542
+ };
543
+ providerType: {
544
+ type: string;
545
+ enum: string[];
546
+ description: string;
547
+ };
548
+ };
549
+ required: string[];
550
+ };
551
+ };
552
+ };
553
+ };
554
+ responses: {
555
+ "200": {
556
+ description: string;
557
+ content: {
558
+ "application/json": {
559
+ schema: {
560
+ type: "object";
561
+ properties: {
562
+ url: {
563
+ type: string;
564
+ format: string;
565
+ description: string;
566
+ };
567
+ redirect: {
568
+ type: string;
569
+ description: string;
570
+ enum: boolean[];
571
+ };
572
+ };
573
+ required: string[];
574
+ };
575
+ };
576
+ };
577
+ };
578
+ };
579
+ };
580
+ };
581
+ }, {
582
+ url: string;
583
+ redirect: boolean;
584
+ }>>;
585
+ callbackSSO: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/callback/:providerId", {
586
+ method: "GET";
587
+ query: import("better-auth").ZodObject<{
588
+ code: import("better-auth").ZodOptional<import("better-auth").ZodString>;
589
+ state: import("better-auth").ZodOptional<import("better-auth").ZodString>;
590
+ error: import("better-auth").ZodOptional<import("better-auth").ZodString>;
591
+ error_description: import("better-auth").ZodOptional<import("better-auth").ZodString>;
592
+ }, import("zod/v4/core").$strip>;
593
+ allowedMediaTypes: readonly ["application/x-www-form-urlencoded", "application/json"];
594
+ metadata: {
595
+ openapi: {
596
+ operationId: string;
597
+ summary: string;
598
+ description: string;
599
+ responses: {
600
+ "302": {
601
+ description: string;
602
+ };
603
+ };
604
+ };
605
+ scope: "server";
606
+ };
607
+ }, never>>;
608
+ callbackSSOShared: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/callback", {
609
+ metadata: {
610
+ openapi: {
611
+ operationId: string;
612
+ summary: string;
613
+ description: string;
614
+ responses: {
615
+ "302": {
616
+ description: string;
617
+ };
618
+ };
619
+ };
620
+ scope: "server";
621
+ };
622
+ method: "GET";
623
+ query: import("better-auth").ZodObject<{
624
+ code: import("better-auth").ZodOptional<import("better-auth").ZodString>;
625
+ state: import("better-auth").ZodOptional<import("better-auth").ZodString>;
626
+ error: import("better-auth").ZodOptional<import("better-auth").ZodString>;
627
+ error_description: import("better-auth").ZodOptional<import("better-auth").ZodString>;
628
+ }, import("zod/v4/core").$strip>;
629
+ allowedMediaTypes: readonly ["application/x-www-form-urlencoded", "application/json"];
630
+ }, never>>;
631
+ acsEndpoint: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/saml2/sp/acs/:providerId", {
632
+ method: ("GET" | "POST")[];
633
+ body: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
634
+ SAMLResponse: import("better-auth").ZodString;
635
+ RelayState: import("better-auth").ZodOptional<import("better-auth").ZodString>;
636
+ }, import("zod/v4/core").$strip>>;
637
+ query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
638
+ RelayState: import("better-auth").ZodOptional<import("better-auth").ZodString>;
639
+ }, import("zod/v4/core").$strip>>;
640
+ metadata: {
641
+ allowedMediaTypes: string[];
642
+ openapi: {
643
+ operationId: string;
644
+ summary: string;
645
+ description: string;
646
+ responses: {
647
+ "302": {
648
+ description: string;
649
+ };
650
+ "400": {
651
+ description: string;
652
+ };
653
+ "404": {
654
+ description: string;
655
+ };
656
+ };
657
+ };
658
+ scope: "server";
659
+ };
660
+ }, never>>;
661
+ sloEndpoint: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/saml2/sp/slo/:providerId", {
662
+ method: ("GET" | "POST")[];
663
+ body: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
664
+ SAMLRequest: import("better-auth").ZodOptional<import("better-auth").ZodString>;
665
+ SAMLResponse: import("better-auth").ZodOptional<import("better-auth").ZodString>;
666
+ RelayState: import("better-auth").ZodOptional<import("better-auth").ZodString>;
667
+ SigAlg: import("better-auth").ZodOptional<import("better-auth").ZodString>;
668
+ Signature: import("better-auth").ZodOptional<import("better-auth").ZodString>;
669
+ }, import("zod/v4/core").$strip>>;
670
+ query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
671
+ SAMLRequest: import("better-auth").ZodOptional<import("better-auth").ZodString>;
672
+ SAMLResponse: import("better-auth").ZodOptional<import("better-auth").ZodString>;
673
+ RelayState: import("better-auth").ZodOptional<import("better-auth").ZodString>;
674
+ SigAlg: import("better-auth").ZodOptional<import("better-auth").ZodString>;
675
+ Signature: import("better-auth").ZodOptional<import("better-auth").ZodString>;
676
+ }, import("zod/v4/core").$strip>>;
677
+ metadata: {
678
+ allowedMediaTypes: string[];
679
+ scope: "server";
680
+ };
681
+ }, void | Response>>;
682
+ initiateSLO: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/saml2/logout/:providerId", {
683
+ method: "POST";
684
+ body: import("better-auth").ZodObject<{
685
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
686
+ }, import("zod/v4/core").$strip>;
687
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
688
+ session: {
689
+ session: Record<string, any> & {
690
+ id: string;
691
+ createdAt: Date;
692
+ updatedAt: Date;
693
+ userId: string;
694
+ expiresAt: Date;
695
+ token: string;
696
+ ipAddress?: string | null | undefined;
697
+ userAgent?: string | null | undefined;
698
+ };
699
+ user: Record<string, any> & {
700
+ id: string;
701
+ createdAt: Date;
702
+ updatedAt: Date;
703
+ email: string;
704
+ emailVerified: boolean;
705
+ name: string;
706
+ image?: string | null | undefined;
707
+ };
708
+ };
709
+ }>>[];
710
+ metadata: {
711
+ readonly scope: "server";
712
+ };
713
+ }, never>>;
714
+ listSSOProviders: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/providers", {
715
+ method: "GET";
716
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
717
+ session: {
718
+ session: Record<string, any> & {
719
+ id: string;
720
+ createdAt: Date;
721
+ updatedAt: Date;
722
+ userId: string;
723
+ expiresAt: Date;
724
+ token: string;
725
+ ipAddress?: string | null | undefined;
726
+ userAgent?: string | null | undefined;
727
+ };
728
+ user: Record<string, any> & {
729
+ id: string;
730
+ createdAt: Date;
731
+ updatedAt: Date;
732
+ email: string;
733
+ emailVerified: boolean;
734
+ name: string;
735
+ image?: string | null | undefined;
736
+ };
737
+ };
738
+ }>>[];
739
+ metadata: {
740
+ openapi: {
741
+ operationId: string;
742
+ summary: string;
743
+ description: string;
744
+ responses: {
745
+ "200": {
746
+ description: string;
747
+ };
748
+ };
749
+ };
750
+ };
751
+ }, {
752
+ providers: {
753
+ providerId: string;
754
+ type: string;
755
+ issuer: string;
756
+ domain: string;
757
+ organizationId: string | null;
758
+ domainVerified: boolean;
759
+ oidcConfig: {
760
+ discoveryEndpoint: string;
761
+ clientIdLastFour: string;
762
+ pkce: boolean;
763
+ authorizationEndpoint: string | undefined;
764
+ tokenEndpoint: string | undefined;
765
+ userInfoEndpoint: string | undefined;
766
+ jwksEndpoint: string | undefined;
767
+ scopes: string[] | undefined;
768
+ tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | "private_key_jwt" | undefined;
769
+ } | undefined;
770
+ samlConfig: {
771
+ entryPoint: string;
772
+ callbackUrl: string | undefined;
773
+ idpInitiatedCallbackUrl: string | undefined;
774
+ audience: string | undefined;
775
+ wantAssertionsSigned: boolean | undefined;
776
+ authnRequestsSigned: boolean | undefined;
777
+ identifierFormat: string | undefined;
778
+ signatureAlgorithm: string | undefined;
779
+ digestAlgorithm: string | undefined;
780
+ certificate: ({
781
+ fingerprintSha256: string;
782
+ notBefore: string;
783
+ notAfter: string;
784
+ publicKeyAlgorithm: string;
785
+ } | {
786
+ error: string;
787
+ })[] | undefined;
788
+ } | undefined;
789
+ spMetadataUrl: string;
790
+ }[];
791
+ }>>;
792
+ getSSOProvider: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/get-provider", {
793
+ method: "GET";
794
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
795
+ session: {
796
+ session: Record<string, any> & {
797
+ id: string;
798
+ createdAt: Date;
799
+ updatedAt: Date;
800
+ userId: string;
801
+ expiresAt: Date;
802
+ token: string;
803
+ ipAddress?: string | null | undefined;
804
+ userAgent?: string | null | undefined;
805
+ };
806
+ user: Record<string, any> & {
807
+ id: string;
808
+ createdAt: Date;
809
+ updatedAt: Date;
810
+ email: string;
811
+ emailVerified: boolean;
812
+ name: string;
813
+ image?: string | null | undefined;
814
+ };
815
+ };
816
+ }>>[];
817
+ query: import("better-auth").ZodObject<{
818
+ providerId: import("better-auth").ZodString;
819
+ }, import("zod/v4/core").$strip>;
820
+ metadata: {
821
+ openapi: {
822
+ operationId: string;
823
+ summary: string;
824
+ description: string;
825
+ responses: {
826
+ "200": {
827
+ description: string;
828
+ };
829
+ "404": {
830
+ description: string;
831
+ };
832
+ "403": {
833
+ description: string;
834
+ };
835
+ };
836
+ };
837
+ };
838
+ }, {
839
+ providerId: string;
840
+ type: string;
841
+ issuer: string;
842
+ domain: string;
843
+ organizationId: string | null;
844
+ domainVerified: boolean;
845
+ oidcConfig: {
846
+ discoveryEndpoint: string;
847
+ clientIdLastFour: string;
848
+ pkce: boolean;
849
+ authorizationEndpoint: string | undefined;
850
+ tokenEndpoint: string | undefined;
851
+ userInfoEndpoint: string | undefined;
852
+ jwksEndpoint: string | undefined;
853
+ scopes: string[] | undefined;
854
+ tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | "private_key_jwt" | undefined;
855
+ } | undefined;
856
+ samlConfig: {
857
+ entryPoint: string;
858
+ callbackUrl: string | undefined;
859
+ idpInitiatedCallbackUrl: string | undefined;
860
+ audience: string | undefined;
861
+ wantAssertionsSigned: boolean | undefined;
862
+ authnRequestsSigned: boolean | undefined;
863
+ identifierFormat: string | undefined;
864
+ signatureAlgorithm: string | undefined;
865
+ digestAlgorithm: string | undefined;
866
+ certificate: ({
867
+ fingerprintSha256: string;
868
+ notBefore: string;
869
+ notAfter: string;
870
+ publicKeyAlgorithm: string;
871
+ } | {
872
+ error: string;
873
+ })[] | undefined;
874
+ } | undefined;
875
+ spMetadataUrl: string;
876
+ }>>;
877
+ updateSSOProvider: ReturnType<(options: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/update-provider", {
878
+ method: "POST";
879
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
880
+ session: {
881
+ session: Record<string, any> & {
882
+ id: string;
883
+ createdAt: Date;
884
+ updatedAt: Date;
885
+ userId: string;
886
+ expiresAt: Date;
887
+ token: string;
888
+ ipAddress?: string | null | undefined;
889
+ userAgent?: string | null | undefined;
890
+ };
891
+ user: Record<string, any> & {
892
+ id: string;
893
+ createdAt: Date;
894
+ updatedAt: Date;
895
+ email: string;
896
+ emailVerified: boolean;
897
+ name: string;
898
+ image?: string | null | undefined;
899
+ };
900
+ };
901
+ }>>[];
902
+ body: import("better-auth").ZodObject<{
903
+ issuer: import("better-auth").ZodOptional<import("better-auth").ZodString>;
904
+ domain: import("better-auth").ZodOptional<import("better-auth").ZodString>;
905
+ oidcConfig: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
906
+ clientId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
907
+ clientSecret: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
908
+ authorizationEndpoint: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
909
+ tokenEndpoint: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
910
+ userInfoEndpoint: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
911
+ tokenEndpointAuthentication: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
912
+ client_secret_post: "client_secret_post";
913
+ client_secret_basic: "client_secret_basic";
914
+ private_key_jwt: "private_key_jwt";
915
+ }>>>;
916
+ privateKeyId: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
917
+ privateKeyAlgorithm: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
918
+ jwksEndpoint: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
919
+ discoveryEndpoint: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
920
+ skipDiscovery: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodBoolean>>;
921
+ scopes: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>>;
922
+ pkce: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodDefault<import("better-auth").ZodBoolean>>>;
923
+ overrideUserInfo: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodBoolean>>;
924
+ mapping: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodObject<{
925
+ email: import("better-auth").ZodOptional<import("better-auth").ZodString>;
926
+ emailVerified: import("better-auth").ZodOptional<import("better-auth").ZodString>;
927
+ name: import("better-auth").ZodOptional<import("better-auth").ZodString>;
928
+ image: import("better-auth").ZodOptional<import("better-auth").ZodString>;
929
+ extraFields: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
930
+ }, import("zod/v4/core").$strict>>>;
931
+ }, import("zod/v4/core").$strip>>;
932
+ samlConfig: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
933
+ mapping: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodObject<{
934
+ email: import("better-auth").ZodOptional<import("better-auth").ZodString>;
935
+ emailVerified: import("better-auth").ZodOptional<import("better-auth").ZodString>;
936
+ name: import("better-auth").ZodOptional<import("better-auth").ZodString>;
937
+ firstName: import("better-auth").ZodOptional<import("better-auth").ZodString>;
938
+ lastName: import("better-auth").ZodOptional<import("better-auth").ZodString>;
939
+ extraFields: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
940
+ }, import("zod/v4/core").$strict>>>;
941
+ privateKey: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
942
+ spMetadata: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodObject<{
943
+ metadata: import("better-auth").ZodOptional<import("better-auth").ZodString>;
944
+ entityID: import("better-auth").ZodOptional<import("better-auth").ZodString>;
945
+ binding: import("better-auth").ZodOptional<import("better-auth").ZodString>;
946
+ privateKey: import("better-auth").ZodOptional<import("better-auth").ZodString>;
947
+ privateKeyPass: import("better-auth").ZodOptional<import("better-auth").ZodString>;
948
+ isAssertionEncrypted: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
949
+ encPrivateKey: import("better-auth").ZodOptional<import("better-auth").ZodString>;
950
+ encPrivateKeyPass: import("better-auth").ZodOptional<import("better-auth").ZodString>;
951
+ }, import("zod/v4/core").$strip>>>;
952
+ cert: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodUnion<readonly [import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>]>>>;
953
+ entryPoint: import("better-auth").ZodOptional<import("better-auth").ZodString>;
954
+ audience: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
955
+ callbackUrl: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
956
+ wantAssertionsSigned: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodBoolean>>;
957
+ authnRequestsSigned: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodBoolean>>;
958
+ signatureAlgorithm: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
959
+ digestAlgorithm: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
960
+ identifierFormat: import("better-auth").ZodOptional<import("better-auth").ZodOptional<import("better-auth").ZodString>>;
961
+ idpInitiatedCallbackUrl: import("better-auth").ZodOptional<import("better-auth").ZodNullable<import("better-auth").ZodString>>;
962
+ idpMetadata: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
963
+ cert: import("better-auth").ZodOptional<import("better-auth").ZodUnion<readonly [import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>]>>;
964
+ privateKey: import("better-auth").ZodOptional<import("better-auth").ZodString>;
965
+ privateKeyPass: import("better-auth").ZodOptional<import("better-auth").ZodString>;
966
+ isAssertionEncrypted: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
967
+ encPrivateKey: import("better-auth").ZodOptional<import("better-auth").ZodString>;
968
+ encPrivateKeyPass: import("better-auth").ZodOptional<import("better-auth").ZodString>;
969
+ singleSignOnService: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodObject<{
970
+ Binding: import("better-auth").ZodString;
971
+ Location: import("better-auth").ZodString;
972
+ }, import("zod/v4/core").$strip>>>;
973
+ singleLogoutService: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodObject<{
974
+ Binding: import("better-auth").ZodString;
975
+ Location: import("better-auth").ZodString;
976
+ }, import("zod/v4/core").$strip>>>;
977
+ metadata: import("better-auth").ZodOptional<import("better-auth").ZodString>;
978
+ entityID: import("better-auth").ZodOptional<import("better-auth").ZodString>;
979
+ }, import("zod/v4/core").$strip>>;
980
+ }, import("zod/v4/core").$strip>>;
981
+ providerId: import("better-auth").ZodString;
982
+ }, import("zod/v4/core").$strip>;
983
+ metadata: {
984
+ openapi: {
985
+ operationId: string;
986
+ summary: string;
987
+ description: string;
988
+ responses: {
989
+ "200": {
990
+ description: string;
991
+ };
992
+ "404": {
993
+ description: string;
994
+ };
995
+ "403": {
996
+ description: string;
997
+ };
998
+ };
999
+ };
1000
+ };
1001
+ }, {
1002
+ providerId: string;
1003
+ type: string;
1004
+ issuer: string;
1005
+ domain: string;
1006
+ organizationId: string | null;
1007
+ domainVerified: boolean;
1008
+ oidcConfig: {
1009
+ discoveryEndpoint: string;
1010
+ clientIdLastFour: string;
1011
+ pkce: boolean;
1012
+ authorizationEndpoint: string | undefined;
1013
+ tokenEndpoint: string | undefined;
1014
+ userInfoEndpoint: string | undefined;
1015
+ jwksEndpoint: string | undefined;
1016
+ scopes: string[] | undefined;
1017
+ tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | "private_key_jwt" | undefined;
1018
+ } | undefined;
1019
+ samlConfig: {
1020
+ entryPoint: string;
1021
+ callbackUrl: string | undefined;
1022
+ idpInitiatedCallbackUrl: string | undefined;
1023
+ audience: string | undefined;
1024
+ wantAssertionsSigned: boolean | undefined;
1025
+ authnRequestsSigned: boolean | undefined;
1026
+ identifierFormat: string | undefined;
1027
+ signatureAlgorithm: string | undefined;
1028
+ digestAlgorithm: string | undefined;
1029
+ certificate: ({
1030
+ fingerprintSha256: string;
1031
+ notBefore: string;
1032
+ notAfter: string;
1033
+ publicKeyAlgorithm: string;
1034
+ } | {
1035
+ error: string;
1036
+ })[] | undefined;
1037
+ } | undefined;
1038
+ spMetadataUrl: string;
1039
+ }>>;
1040
+ deleteSSOProvider: ReturnType<(options?: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/delete-provider", {
1041
+ method: "POST";
1042
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1043
+ session: {
1044
+ session: Record<string, any> & {
1045
+ id: string;
1046
+ createdAt: Date;
1047
+ updatedAt: Date;
1048
+ userId: string;
1049
+ expiresAt: Date;
1050
+ token: string;
1051
+ ipAddress?: string | null | undefined;
1052
+ userAgent?: string | null | undefined;
1053
+ };
1054
+ user: Record<string, any> & {
1055
+ id: string;
1056
+ createdAt: Date;
1057
+ updatedAt: Date;
1058
+ email: string;
1059
+ emailVerified: boolean;
1060
+ name: string;
1061
+ image?: string | null | undefined;
1062
+ };
1063
+ };
1064
+ }>>[];
1065
+ body: import("better-auth").ZodObject<{
1066
+ providerId: import("better-auth").ZodString;
1067
+ }, import("zod/v4/core").$strip>;
1068
+ metadata: {
1069
+ openapi: {
1070
+ operationId: string;
1071
+ summary: string;
1072
+ description: string;
1073
+ responses: {
1074
+ "200": {
1075
+ description: string;
1076
+ };
1077
+ "404": {
1078
+ description: string;
1079
+ };
1080
+ "403": {
1081
+ description: string;
1082
+ };
1083
+ };
1084
+ };
1085
+ };
1086
+ }, {
1087
+ success: boolean;
1088
+ }>>;
1089
+ } & {
1090
+ requestDomainVerification: ReturnType<(options: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/request-domain-verification", {
1091
+ method: "POST";
1092
+ body: import("better-auth").ZodObject<{
1093
+ providerId: import("better-auth").ZodString;
1094
+ }, import("zod/v4/core").$strip>;
1095
+ metadata: {
1096
+ openapi: {
1097
+ summary: string;
1098
+ description: string;
1099
+ responses: {
1100
+ "404": {
1101
+ description: string;
1102
+ };
1103
+ "409": {
1104
+ description: string;
1105
+ };
1106
+ "201": {
1107
+ description: string;
1108
+ };
1109
+ };
1110
+ };
1111
+ };
1112
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1113
+ session: {
1114
+ session: Record<string, any> & {
1115
+ id: string;
1116
+ createdAt: Date;
1117
+ updatedAt: Date;
1118
+ userId: string;
1119
+ expiresAt: Date;
1120
+ token: string;
1121
+ ipAddress?: string | null | undefined;
1122
+ userAgent?: string | null | undefined;
1123
+ };
1124
+ user: Record<string, any> & {
1125
+ id: string;
1126
+ createdAt: Date;
1127
+ updatedAt: Date;
1128
+ email: string;
1129
+ emailVerified: boolean;
1130
+ name: string;
1131
+ image?: string | null | undefined;
1132
+ };
1133
+ };
1134
+ }>>[];
1135
+ }, {
1136
+ domainVerificationToken: string;
1137
+ }>>;
1138
+ verifyDomain: ReturnType<(options: import("@better-auth/sso").SSOOptions) => import("better-auth").StrictEndpoint<"/sso/verify-domain", {
1139
+ method: "POST";
1140
+ body: import("better-auth").ZodObject<{
1141
+ providerId: import("better-auth").ZodString;
1142
+ }, import("zod/v4/core").$strip>;
1143
+ metadata: {
1144
+ openapi: {
1145
+ summary: string;
1146
+ description: string;
1147
+ responses: {
1148
+ "404": {
1149
+ description: string;
1150
+ };
1151
+ "409": {
1152
+ description: string;
1153
+ };
1154
+ "502": {
1155
+ description: string;
1156
+ };
1157
+ "204": {
1158
+ description: string;
1159
+ };
1160
+ };
1161
+ };
1162
+ };
1163
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1164
+ session: {
1165
+ session: Record<string, any> & {
1166
+ id: string;
1167
+ createdAt: Date;
1168
+ updatedAt: Date;
1169
+ userId: string;
1170
+ expiresAt: Date;
1171
+ token: string;
1172
+ ipAddress?: string | null | undefined;
1173
+ userAgent?: string | null | undefined;
1174
+ };
1175
+ user: Record<string, any> & {
1176
+ id: string;
1177
+ createdAt: Date;
1178
+ updatedAt: Date;
1179
+ email: string;
1180
+ emailVerified: boolean;
1181
+ name: string;
1182
+ image?: string | null | undefined;
1183
+ };
1184
+ };
1185
+ }>>[];
1186
+ }, void>>;
1187
+ };
1188
+ schema: {
1189
+ ssoProvider: {
1190
+ modelName: string;
1191
+ fields: Record<string, import("better-auth").DBFieldAttribute>;
1192
+ };
1193
+ };
1194
+ $Infer: {
1195
+ SSOProvider: {
1196
+ domainVerified: boolean;
1197
+ } & {
1198
+ issuer: string;
1199
+ oidcConfig?: import("@better-auth/sso").OIDCConfig | undefined;
1200
+ samlConfig?: import("@better-auth/sso").SAMLConfig | undefined;
1201
+ userId: string;
1202
+ providerId: string;
1203
+ organizationId?: string | undefined;
1204
+ domain: string;
1205
+ };
1206
+ };
1207
+ options: NoInfer<{
1208
+ modelName: string;
1209
+ providersLimit: number;
1210
+ redirectURI: string;
1211
+ domainVerification: {
1212
+ enabled: true;
1213
+ };
1214
+ organizationProvisioning: {
1215
+ disabled: true;
1216
+ };
1217
+ trustEmailVerified: true;
1218
+ saml: {
1219
+ allowIdpInitiated: false;
1220
+ enableInResponseToValidation: true;
1221
+ requireTimestamps: true;
1222
+ };
1223
+ defaultSSO: ({
1224
+ domain: string;
1225
+ providerId: string;
1226
+ oidcConfig: {
1227
+ issuer: string;
1228
+ clientId: string;
1229
+ clientSecret: string;
1230
+ authorizationEndpoint: string;
1231
+ tokenEndpoint: string;
1232
+ jwksEndpoint: string;
1233
+ tokenEndpointAuthentication: "client_secret_basic" | "client_secret_post" | undefined;
1234
+ discoveryEndpoint: string;
1235
+ pkce: boolean;
1236
+ scopes: string[];
1237
+ };
1238
+ } | {
1239
+ domain: string;
1240
+ providerId: string;
1241
+ samlConfig: {
1242
+ issuer: string;
1243
+ entryPoint: string;
1244
+ cert: string;
1245
+ callbackUrl: string;
1246
+ idpMetadata: {
1247
+ entityID: string;
1248
+ cert: string;
1249
+ };
1250
+ spMetadata: {
1251
+ entityID: string;
1252
+ };
1253
+ wantAssertionsSigned: boolean;
1254
+ identifierFormat: string;
1255
+ mapping: {
1256
+ email: string | undefined;
1257
+ };
1258
+ };
1259
+ })[];
1260
+ resolveUser: (input: import("@better-auth/sso").SSOUserResolutionInput, context: import("@better-auth/sso").SSOUserResolutionContext) => import("better-auth").Awaitable<import("@better-auth/sso").SSOUserResolution>;
1261
+ guardProviderMutation: () => never;
1262
+ }>;
1263
+ }[], {
65
1264
  id: "jwt";
66
1265
  version: string;
67
1266
  options: NoInfer<{
@@ -83,6 +1282,20 @@ export declare function configureBetterAuth(options: BetterAuthIdentityOptions,
83
1282
  };
84
1283
  };
85
1284
  }>;
1285
+ init(ctx: import("better-auth").AuthContext): {
1286
+ context: {
1287
+ sessionConfig: {
1288
+ cookieCacheSigner: import("better-auth").CookieCacheSigner;
1289
+ updateAge: number;
1290
+ expiresIn: number;
1291
+ freshAge: number;
1292
+ cookieRefreshCache: false | {
1293
+ enabled: true;
1294
+ updateAge: number;
1295
+ };
1296
+ };
1297
+ };
1298
+ } | undefined;
86
1299
  endpoints: {
87
1300
  getJwks: import("better-auth").StrictEndpoint<string, {
88
1301
  method: "GET";
@@ -164,7 +1377,7 @@ export declare function configureBetterAuth(options: BetterAuthIdentityOptions,
164
1377
  getToken: import("better-auth").StrictEndpoint<"/token", {
165
1378
  method: "GET";
166
1379
  requireHeaders: true;
167
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1380
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
168
1381
  session: {
169
1382
  session: Record<string, any> & {
170
1383
  id: string;
@@ -186,7 +1399,7 @@ export declare function configureBetterAuth(options: BetterAuthIdentityOptions,
186
1399
  image?: string | null | undefined;
187
1400
  };
188
1401
  };
189
- }>)[];
1402
+ }>>[];
190
1403
  metadata: {
191
1404
  openapi: {
192
1405
  operationId: string;
@@ -258,7 +1471,7 @@ export declare function configureBetterAuth(options: BetterAuthIdentityOptions,
258
1471
  hooks: {
259
1472
  after: {
260
1473
  matcher(context: import("better-auth").HookEndpointContext): boolean;
261
- handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>;
1474
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>;
262
1475
  }[];
263
1476
  };
264
1477
  schema: {
@@ -280,6 +1493,14 @@ export declare function configureBetterAuth(options: BetterAuthIdentityOptions,
280
1493
  type: "date";
281
1494
  required: false;
282
1495
  };
1496
+ alg: {
1497
+ type: "string";
1498
+ required: false;
1499
+ };
1500
+ crv: {
1501
+ type: "string";
1502
+ required: false;
1503
+ };
283
1504
  };
284
1505
  };
285
1506
  };