@dads-framework/identity 0.5.1 → 0.6.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 (35) hide show
  1. package/README.md +4 -0
  2. package/dist/better-auth/lib/configure-better-auth.d.ts +8 -1033
  3. package/dist/better-auth/lib/configure-better-auth.d.ts.map +1 -1
  4. package/dist/better-auth/lib/configure-better-auth.js +7 -8
  5. package/dist/better-auth/lib/configure-better-auth.js.map +1 -1
  6. package/dist/better-auth/lib/create-better-auth-identity.d.ts.map +1 -1
  7. package/dist/better-auth/lib/create-better-auth-identity.js +7 -3
  8. package/dist/better-auth/lib/create-better-auth-identity.js.map +1 -1
  9. package/dist/better-auth/lib/enterprise-options.d.ts +3 -0
  10. package/dist/better-auth/lib/enterprise-options.d.ts.map +1 -1
  11. package/dist/better-auth/lib/enterprise-options.js +6 -0
  12. package/dist/better-auth/lib/enterprise-options.js.map +1 -1
  13. package/dist/better-auth/lib/enterprise-plugin.d.ts +0 -3
  14. package/dist/better-auth/lib/enterprise-plugin.d.ts.map +1 -1
  15. package/dist/better-auth/lib/enterprise-plugin.js +1 -7
  16. package/dist/better-auth/lib/enterprise-plugin.js.map +1 -1
  17. package/dist/better-auth/lib/enterprise-routes.d.ts.map +1 -1
  18. package/dist/better-auth/lib/enterprise-routes.js +1 -2
  19. package/dist/better-auth/lib/enterprise-routes.js.map +1 -1
  20. package/dist/better-auth/lib/identity-options.d.ts +3 -0
  21. package/dist/better-auth/lib/identity-options.d.ts.map +1 -1
  22. package/dist/better-auth/lib/identity-options.js.map +1 -1
  23. package/dist/better-auth/lib/identity-session-readers.d.ts.map +1 -1
  24. package/dist/better-auth/lib/identity-session-readers.js +1 -2
  25. package/dist/better-auth/lib/identity-session-readers.js.map +1 -1
  26. package/dist/identity.tsbuildinfo +1 -1
  27. package/dist/tenants/contract.d.ts +10 -0
  28. package/dist/tenants/contract.d.ts.map +1 -0
  29. package/dist/tenants/contract.js +5 -0
  30. package/dist/tenants/contract.js.map +1 -0
  31. package/dist/tenants/tenant-access.d.ts +3 -10
  32. package/dist/tenants/tenant-access.d.ts.map +1 -1
  33. package/dist/tenants/tenant-access.js +2 -4
  34. package/dist/tenants/tenant-access.js.map +1 -1
  35. package/package.json +10 -6
@@ -1,8 +1,12 @@
1
1
  import type { IdentityEmail } from "../../index.js";
2
+ import { type BetterAuthOptions } from "better-auth";
2
3
  import { PostgresDialect } from "kysely";
3
4
  import { type BetterAuthIdentityOptions } from "./identity-options.js";
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
+ export type EnterpriseAuthExtension = {
6
+ readonly databaseHooks: NonNullable<BetterAuthOptions["databaseHooks"]>;
7
+ readonly plugin: NonNullable<BetterAuthOptions["plugins"]>[number];
8
+ };
9
+ export declare function configureBetterAuth(options: BetterAuthIdentityOptions, origin: string, sendEmail: (email: IdentityEmail) => void, enterprise?: EnterpriseAuthExtension): import("better-auth").Auth<{
6
10
  baseURL: string;
7
11
  basePath: string;
8
12
  secret: string;
@@ -223,7 +227,7 @@ export declare function configureBetterAuth(options: BetterAuthIdentityOptions,
223
227
  }) => Promise<void>;
224
228
  };
225
229
  rateLimit: {
226
- enabled: true;
230
+ enabled: boolean;
227
231
  };
228
232
  telemetry: {
229
233
  enabled: false;
@@ -231,1036 +235,7 @@ export declare function configureBetterAuth(options: BetterAuthIdentityOptions,
231
235
  logger: {
232
236
  disabled: true;
233
237
  };
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
- }[], {
238
+ plugins: [...import("better-auth").BetterAuthPlugin[], {
1264
239
  id: "jwt";
1265
240
  version: string;
1266
241
  options: NoInfer<{