@better-auth/electron 1.7.0-beta.7 → 1.7.0-beta.9

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/client.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-DQW8cveo.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-B__xynWl.mjs";
2
2
  import { n as isProcessType, r as parseProtocolScheme, t as getChannelPrefixWithDelimiter } from "./utils-DxDKRT6e.mjs";
3
3
  import { BetterAuthError } from "@better-auth/core/error";
4
4
  import { base64, base64Url } from "@better-auth/utils/base64";
package/dist/index.d.mts CHANGED
@@ -99,7 +99,7 @@ declare const electron: (options?: ElectronOptions | undefined) => {
99
99
  image?: string | null | undefined;
100
100
  } & Record<string, any>;
101
101
  } | null) => void;
102
- socialProviders: better_auth0.UpstreamProvider[];
102
+ socialProviders: better_auth0.OAuthProvider[];
103
103
  authCookies: better_auth0.BetterAuthCookies;
104
104
  logger: ReturnType<typeof better_auth0.createLogger>;
105
105
  rateLimit: {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-DQW8cveo.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-B__xynWl.mjs";
2
2
  import { createAuthMiddleware } from "@better-auth/core/api";
3
3
  import { APIError, BASE_ERROR_CODES } from "@better-auth/core/error";
4
4
  import { base64Url } from "@better-auth/utils/base64";
@@ -767,58 +767,19 @@ interface OAuthRefreshContext {
767
767
  headers?: Headers | undefined;
768
768
  request?: Request | undefined;
769
769
  }
770
- /**
771
- * The result of building a provider authorization URL.
772
- *
773
- * `requestedScopes` is the effective set of scopes encoded in the URL (the
774
- * provider's built-in defaults + configured `options.scope` + per-request
775
- * `scopes`, composed by `resolveRequestedScopes`). Callers persist it so the
776
- * callback can fall back to the request when the provider omits `scope` from
777
- * its token response (RFC 6749 §5.1).
778
- */
779
- interface AuthorizationURLResult {
780
- url: URL;
781
- requestedScopes: string[];
782
- }
783
- /**
784
- * How much an RP trusts a provider's echoed token-response `scope` when
785
- * persisting `account.grantedScopes`.
786
- *
787
- * - `"full-grant"`: the echo is the user's complete current grant, so the seam
788
- * replaces the stored grant with it. This is the only path that may narrow
789
- * the grant. Declare it only for providers whose token response reports the
790
- * full combined grant, e.g. Google with `include_granted_scopes`.
791
- * - `"projection"`: the echo is this request's subset, so the seam unions it
792
- * onto the stored grant. The safe default for every provider.
793
- * - `"absent-echo"`: the provider omitted `scope`, so the grant equals what was
794
- * requested (RFC 6749 §5.1) and the seam unions the requested set. Resolved
795
- * at runtime by the persistence seam, never declared by a provider.
796
- *
797
- * @see https://www.rfc-editor.org/rfc/rfc6749#section-5.1
798
- */
799
- type GrantAuthority = "full-grant" | "projection" | "absent-echo";
800
- /**
801
- * The authority a provider may declare for its own echoed scope. `"absent-echo"`
802
- * is excluded because it is a runtime condition (an omitted echo), not a
803
- * provider trait.
804
- */
805
- type ProviderGrantAuthority = Exclude<GrantAuthority, "absent-echo">;
806
- interface UpstreamProvider<T extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Partial<ProviderOptions>> {
770
+ interface OAuthProvider<T extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Partial<ProviderOptions>> {
807
771
  id: LiteralString;
808
772
  /**
809
- * The path the provider redirects back to, relative to the app base URL,
810
- * e.g. `/callback/google`.
811
- */
812
- callbackPath: string;
813
- /**
814
- * How the persistence seam treats this provider's echoed token-response
815
- * `scope`. Declare `"full-grant"` only when the echo is the user's complete
816
- * current grant (e.g. Google with `include_granted_scopes`); otherwise the
817
- * echo is unioned onto the stored grant.
773
+ * Optional path under the resolved per-request `baseURL` where this
774
+ * provider's OAuth callback handler is mounted. Providers that use the
775
+ * shared `/callback/<id>` route can omit this.
776
+ *
777
+ * Custom paths must start with `/`.
818
778
  *
819
- * @default "projection"
779
+ * Endpoints compose `redirectURI = ctx.context.baseURL + callbackPath` per
780
+ * request, so the provider must not hardcode an origin or `baseURL` here.
820
781
  */
821
- grantAuthority?: ProviderGrantAuthority | undefined;
782
+ callbackPath?: string | undefined;
822
783
  createAuthorizationURL: (data: {
823
784
  state: string;
824
785
  codeVerifier: string;
@@ -839,7 +800,7 @@ interface UpstreamProvider<T extends Record<string, any> = Record<string, any>,
839
800
  * before applying them.
840
801
  */
841
802
  additionalParams?: Record<string, string> | undefined;
842
- }) => Awaitable<AuthorizationURLResult>;
803
+ }) => Awaitable<URL>;
843
804
  name: string;
844
805
  validateAuthorizationCode: (data: {
845
806
  code: string;
@@ -877,6 +838,7 @@ interface UpstreamProvider<T extends Record<string, any> = Record<string, any>,
877
838
  * argument.
878
839
  */
879
840
  refreshAccessToken?: ((refreshToken: string, ctx?: OAuthRefreshContext) => Promise<OAuth2Tokens>) | undefined;
841
+ revokeToken?: ((token: string) => Promise<void>) | undefined;
880
842
  /**
881
843
  * Declarative id_token verification config consumed by the shared
882
844
  * `verifyProviderIdToken` verifier. Providers set this instead of implementing a boolean
@@ -1553,11 +1515,14 @@ interface GoogleOptions extends ProviderOptions<GoogleProfile> {
1553
1515
  */
1554
1516
  hd?: string | undefined;
1555
1517
  /**
1556
- * Enable incremental authorization via Google's `include_granted_scopes`
1557
- * parameter. When enabled, Google reports the user's full granted scope set
1558
- * in the token response.
1518
+ * Whether to send `include_granted_scopes=true` to Google's authorization
1519
+ * endpoint, which lets new access tokens cover scopes from prior grants
1520
+ * in addition to the ones requested for this flow. Set to `false` when
1521
+ * each OAuth flow should request only its own scopes.
1559
1522
  *
1560
- * @default true
1523
+ * Defaults to `true`.
1524
+ *
1525
+ * @see https://developers.google.com/identity/protocols/oauth2/web-server#incrementalAuth
1561
1526
  */
1562
1527
  includeGrantedScopes?: boolean | undefined;
1563
1528
  }
@@ -2430,7 +2395,6 @@ declare const socialProviders: {
2430
2395
  apple: (options: AppleOptions) => {
2431
2396
  id: "apple";
2432
2397
  name: string;
2433
- callbackPath: string;
2434
2398
  createAuthorizationURL({
2435
2399
  state,
2436
2400
  scopes,
@@ -2445,10 +2409,7 @@ declare const socialProviders: {
2445
2409
  loginHint?: string | undefined;
2446
2410
  idTokenNonce?: string | undefined;
2447
2411
  additionalParams?: Record<string, string> | undefined;
2448
- }): Promise<{
2449
- url: URL;
2450
- requestedScopes: string[];
2451
- }>;
2412
+ }): Promise<URL>;
2452
2413
  validateAuthorizationCode: ({
2453
2414
  code,
2454
2415
  codeVerifier,
@@ -2492,7 +2453,6 @@ declare const socialProviders: {
2492
2453
  atlassian: (options: AtlassianOptions) => {
2493
2454
  id: "atlassian";
2494
2455
  name: string;
2495
- callbackPath: string;
2496
2456
  createAuthorizationURL({
2497
2457
  state,
2498
2458
  scopes,
@@ -2508,10 +2468,7 @@ declare const socialProviders: {
2508
2468
  loginHint?: string | undefined;
2509
2469
  idTokenNonce?: string | undefined;
2510
2470
  additionalParams?: Record<string, string> | undefined;
2511
- }): Promise<{
2512
- url: URL;
2513
- requestedScopes: string[];
2514
- }>;
2471
+ }): Promise<URL>;
2515
2472
  validateAuthorizationCode: ({
2516
2473
  code,
2517
2474
  codeVerifier,
@@ -2548,7 +2505,6 @@ declare const socialProviders: {
2548
2505
  cognito: (options: CognitoOptions) => {
2549
2506
  id: "cognito";
2550
2507
  name: string;
2551
- callbackPath: string;
2552
2508
  createAuthorizationURL({
2553
2509
  state,
2554
2510
  scopes,
@@ -2564,10 +2520,7 @@ declare const socialProviders: {
2564
2520
  loginHint?: string | undefined;
2565
2521
  idTokenNonce?: string | undefined;
2566
2522
  additionalParams?: Record<string, string> | undefined;
2567
- }): Promise<{
2568
- url: URL;
2569
- requestedScopes: string[];
2570
- }>;
2523
+ }): Promise<URL>;
2571
2524
  validateAuthorizationCode: ({
2572
2525
  code,
2573
2526
  codeVerifier,
@@ -2610,7 +2563,6 @@ declare const socialProviders: {
2610
2563
  discord: (options: DiscordOptions) => {
2611
2564
  id: "discord";
2612
2565
  name: string;
2613
- callbackPath: string;
2614
2566
  createAuthorizationURL({
2615
2567
  state,
2616
2568
  scopes,
@@ -2625,10 +2577,7 @@ declare const socialProviders: {
2625
2577
  loginHint?: string | undefined;
2626
2578
  idTokenNonce?: string | undefined;
2627
2579
  additionalParams?: Record<string, string> | undefined;
2628
- }): Promise<{
2629
- url: URL;
2630
- requestedScopes: string[];
2631
- }>;
2580
+ }): Promise<URL>;
2632
2581
  validateAuthorizationCode: ({
2633
2582
  code,
2634
2583
  redirectURI
@@ -2664,7 +2613,6 @@ declare const socialProviders: {
2664
2613
  facebook: (options: FacebookOptions) => {
2665
2614
  id: "facebook";
2666
2615
  name: string;
2667
- callbackPath: string;
2668
2616
  createAuthorizationURL({
2669
2617
  state,
2670
2618
  scopes,
@@ -2680,10 +2628,7 @@ declare const socialProviders: {
2680
2628
  loginHint?: string | undefined;
2681
2629
  idTokenNonce?: string | undefined;
2682
2630
  additionalParams?: Record<string, string> | undefined;
2683
- }): Promise<{
2684
- url: URL;
2685
- requestedScopes: string[];
2686
- }>;
2631
+ }): Promise<URL>;
2687
2632
  validateAuthorizationCode: ({
2688
2633
  code,
2689
2634
  redirectURI
@@ -2733,7 +2678,6 @@ declare const socialProviders: {
2733
2678
  figma: (options: FigmaOptions) => {
2734
2679
  id: "figma";
2735
2680
  name: string;
2736
- callbackPath: string;
2737
2681
  createAuthorizationURL({
2738
2682
  state,
2739
2683
  scopes,
@@ -2749,10 +2693,7 @@ declare const socialProviders: {
2749
2693
  loginHint?: string | undefined;
2750
2694
  idTokenNonce?: string | undefined;
2751
2695
  additionalParams?: Record<string, string> | undefined;
2752
- }): Promise<{
2753
- url: URL;
2754
- requestedScopes: string[];
2755
- }>;
2696
+ }): Promise<URL>;
2756
2697
  validateAuthorizationCode: ({
2757
2698
  code,
2758
2699
  codeVerifier,
@@ -2789,7 +2730,6 @@ declare const socialProviders: {
2789
2730
  github: (options: GithubOptions) => {
2790
2731
  id: "github";
2791
2732
  name: string;
2792
- callbackPath: string;
2793
2733
  createAuthorizationURL({
2794
2734
  state,
2795
2735
  scopes,
@@ -2806,10 +2746,7 @@ declare const socialProviders: {
2806
2746
  loginHint?: string | undefined;
2807
2747
  idTokenNonce?: string | undefined;
2808
2748
  additionalParams?: Record<string, string> | undefined;
2809
- }): Promise<{
2810
- url: URL;
2811
- requestedScopes: string[];
2812
- }>;
2749
+ }): Promise<URL>;
2813
2750
  validateAuthorizationCode: ({
2814
2751
  code,
2815
2752
  codeVerifier,
@@ -2846,7 +2783,6 @@ declare const socialProviders: {
2846
2783
  microsoft: (options: MicrosoftOptions) => {
2847
2784
  id: "microsoft";
2848
2785
  name: string;
2849
- callbackPath: string;
2850
2786
  createAuthorizationURL(data: {
2851
2787
  state: string;
2852
2788
  codeVerifier: string;
@@ -2856,10 +2792,7 @@ declare const socialProviders: {
2856
2792
  loginHint?: string | undefined;
2857
2793
  idTokenNonce?: string | undefined;
2858
2794
  additionalParams?: Record<string, string> | undefined;
2859
- }): Promise<{
2860
- url: URL;
2861
- requestedScopes: string[];
2862
- }>;
2795
+ }): Promise<URL>;
2863
2796
  validateAuthorizationCode({
2864
2797
  code,
2865
2798
  codeVerifier,
@@ -2903,8 +2836,6 @@ declare const socialProviders: {
2903
2836
  google: (options: GoogleOptions) => {
2904
2837
  id: "google";
2905
2838
  name: string;
2906
- callbackPath: string;
2907
- grantAuthority: "full-grant" | "projection";
2908
2839
  createAuthorizationURL({
2909
2840
  state,
2910
2841
  scopes,
@@ -2922,10 +2853,7 @@ declare const socialProviders: {
2922
2853
  loginHint?: string | undefined;
2923
2854
  idTokenNonce?: string | undefined;
2924
2855
  additionalParams?: Record<string, string> | undefined;
2925
- }): Promise<{
2926
- url: URL;
2927
- requestedScopes: string[];
2928
- }>;
2856
+ }): Promise<URL>;
2929
2857
  validateAuthorizationCode: ({
2930
2858
  code,
2931
2859
  codeVerifier,
@@ -2969,7 +2897,6 @@ declare const socialProviders: {
2969
2897
  huggingface: (options: HuggingFaceOptions) => {
2970
2898
  id: "huggingface";
2971
2899
  name: string;
2972
- callbackPath: string;
2973
2900
  createAuthorizationURL({
2974
2901
  state,
2975
2902
  scopes,
@@ -2985,10 +2912,7 @@ declare const socialProviders: {
2985
2912
  loginHint?: string | undefined;
2986
2913
  idTokenNonce?: string | undefined;
2987
2914
  additionalParams?: Record<string, string> | undefined;
2988
- }): Promise<{
2989
- url: URL;
2990
- requestedScopes: string[];
2991
- }>;
2915
+ }): Promise<URL>;
2992
2916
  validateAuthorizationCode: ({
2993
2917
  code,
2994
2918
  codeVerifier,
@@ -3025,7 +2949,6 @@ declare const socialProviders: {
3025
2949
  slack: (options: SlackOptions) => {
3026
2950
  id: "slack";
3027
2951
  name: string;
3028
- callbackPath: string;
3029
2952
  createAuthorizationURL({
3030
2953
  state,
3031
2954
  scopes,
@@ -3040,10 +2963,7 @@ declare const socialProviders: {
3040
2963
  loginHint?: string | undefined;
3041
2964
  idTokenNonce?: string | undefined;
3042
2965
  additionalParams?: Record<string, string> | undefined;
3043
- }): Promise<{
3044
- url: URL;
3045
- requestedScopes: string[];
3046
- }>;
2966
+ }): Promise<URL>;
3047
2967
  validateAuthorizationCode: ({
3048
2968
  code,
3049
2969
  redirectURI
@@ -3079,7 +2999,6 @@ declare const socialProviders: {
3079
2999
  spotify: (options: SpotifyOptions) => {
3080
3000
  id: "spotify";
3081
3001
  name: string;
3082
- callbackPath: string;
3083
3002
  createAuthorizationURL({
3084
3003
  state,
3085
3004
  scopes,
@@ -3095,10 +3014,7 @@ declare const socialProviders: {
3095
3014
  loginHint?: string | undefined;
3096
3015
  idTokenNonce?: string | undefined;
3097
3016
  additionalParams?: Record<string, string> | undefined;
3098
- }): Promise<{
3099
- url: URL;
3100
- requestedScopes: string[];
3101
- }>;
3017
+ }): Promise<URL>;
3102
3018
  validateAuthorizationCode: ({
3103
3019
  code,
3104
3020
  codeVerifier,
@@ -3135,7 +3051,6 @@ declare const socialProviders: {
3135
3051
  twitch: (options: TwitchOptions) => {
3136
3052
  id: "twitch";
3137
3053
  name: string;
3138
- callbackPath: string;
3139
3054
  createAuthorizationURL({
3140
3055
  state,
3141
3056
  scopes,
@@ -3150,10 +3065,7 @@ declare const socialProviders: {
3150
3065
  loginHint?: string | undefined;
3151
3066
  idTokenNonce?: string | undefined;
3152
3067
  additionalParams?: Record<string, string> | undefined;
3153
- }): Promise<{
3154
- url: URL;
3155
- requestedScopes: string[];
3156
- }>;
3068
+ }): Promise<URL>;
3157
3069
  validateAuthorizationCode: ({
3158
3070
  code,
3159
3071
  redirectURI
@@ -3189,7 +3101,6 @@ declare const socialProviders: {
3189
3101
  twitter: (options: TwitterOption) => {
3190
3102
  id: "twitter";
3191
3103
  name: string;
3192
- callbackPath: string;
3193
3104
  createAuthorizationURL(data: {
3194
3105
  state: string;
3195
3106
  codeVerifier: string;
@@ -3199,10 +3110,7 @@ declare const socialProviders: {
3199
3110
  loginHint?: string | undefined;
3200
3111
  idTokenNonce?: string | undefined;
3201
3112
  additionalParams?: Record<string, string> | undefined;
3202
- }): Promise<{
3203
- url: URL;
3204
- requestedScopes: string[];
3205
- }>;
3113
+ }): Promise<URL>;
3206
3114
  validateAuthorizationCode: ({
3207
3115
  code,
3208
3116
  codeVerifier,
@@ -3239,7 +3147,6 @@ declare const socialProviders: {
3239
3147
  dropbox: (options: DropboxOptions) => {
3240
3148
  id: "dropbox";
3241
3149
  name: string;
3242
- callbackPath: string;
3243
3150
  createAuthorizationURL: ({
3244
3151
  state,
3245
3152
  scopes,
@@ -3255,10 +3162,7 @@ declare const socialProviders: {
3255
3162
  loginHint?: string | undefined;
3256
3163
  idTokenNonce?: string | undefined;
3257
3164
  additionalParams?: Record<string, string> | undefined;
3258
- }) => Promise<{
3259
- url: URL;
3260
- requestedScopes: string[];
3261
- }>;
3165
+ }) => Promise<URL>;
3262
3166
  validateAuthorizationCode: ({
3263
3167
  code,
3264
3168
  codeVerifier,
@@ -3295,7 +3199,6 @@ declare const socialProviders: {
3295
3199
  kick: (options: KickOptions) => {
3296
3200
  id: "kick";
3297
3201
  name: string;
3298
- callbackPath: string;
3299
3202
  createAuthorizationURL({
3300
3203
  state,
3301
3204
  scopes,
@@ -3311,10 +3214,7 @@ declare const socialProviders: {
3311
3214
  loginHint?: string | undefined;
3312
3215
  idTokenNonce?: string | undefined;
3313
3216
  additionalParams?: Record<string, string> | undefined;
3314
- }): Promise<{
3315
- url: URL;
3316
- requestedScopes: string[];
3317
- }>;
3217
+ }): Promise<URL>;
3318
3218
  validateAuthorizationCode({
3319
3219
  code,
3320
3220
  redirectURI,
@@ -3351,7 +3251,6 @@ declare const socialProviders: {
3351
3251
  linear: (options: LinearOptions) => {
3352
3252
  id: "linear";
3353
3253
  name: string;
3354
- callbackPath: string;
3355
3254
  createAuthorizationURL({
3356
3255
  state,
3357
3256
  scopes,
@@ -3367,10 +3266,7 @@ declare const socialProviders: {
3367
3266
  loginHint?: string | undefined;
3368
3267
  idTokenNonce?: string | undefined;
3369
3268
  additionalParams?: Record<string, string> | undefined;
3370
- }): Promise<{
3371
- url: URL;
3372
- requestedScopes: string[];
3373
- }>;
3269
+ }): Promise<URL>;
3374
3270
  validateAuthorizationCode: ({
3375
3271
  code,
3376
3272
  redirectURI
@@ -3406,7 +3302,6 @@ declare const socialProviders: {
3406
3302
  linkedin: (options: LinkedInOptions) => {
3407
3303
  id: "linkedin";
3408
3304
  name: string;
3409
- callbackPath: string;
3410
3305
  createAuthorizationURL: ({
3411
3306
  state,
3412
3307
  scopes,
@@ -3422,10 +3317,7 @@ declare const socialProviders: {
3422
3317
  loginHint?: string | undefined;
3423
3318
  idTokenNonce?: string | undefined;
3424
3319
  additionalParams?: Record<string, string> | undefined;
3425
- }) => Promise<{
3426
- url: URL;
3427
- requestedScopes: string[];
3428
- }>;
3320
+ }) => Promise<URL>;
3429
3321
  validateAuthorizationCode: ({
3430
3322
  code,
3431
3323
  redirectURI
@@ -3461,7 +3353,6 @@ declare const socialProviders: {
3461
3353
  gitlab: (options: GitlabOptions) => {
3462
3354
  id: "gitlab";
3463
3355
  name: string;
3464
- callbackPath: string;
3465
3356
  createAuthorizationURL: ({
3466
3357
  state,
3467
3358
  scopes,
@@ -3478,10 +3369,7 @@ declare const socialProviders: {
3478
3369
  loginHint?: string | undefined;
3479
3370
  idTokenNonce?: string | undefined;
3480
3371
  additionalParams?: Record<string, string> | undefined;
3481
- }) => Promise<{
3482
- url: URL;
3483
- requestedScopes: string[];
3484
- }>;
3372
+ }) => Promise<URL>;
3485
3373
  validateAuthorizationCode: ({
3486
3374
  code,
3487
3375
  redirectURI,
@@ -3539,7 +3427,6 @@ declare const socialProviders: {
3539
3427
  tiktok: (options: TiktokOptions) => {
3540
3428
  id: "tiktok";
3541
3429
  name: string;
3542
- callbackPath: string;
3543
3430
  createAuthorizationURL({
3544
3431
  state,
3545
3432
  scopes,
@@ -3554,10 +3441,7 @@ declare const socialProviders: {
3554
3441
  loginHint?: string | undefined;
3555
3442
  idTokenNonce?: string | undefined;
3556
3443
  additionalParams?: Record<string, string> | undefined;
3557
- }): {
3558
- url: URL;
3559
- requestedScopes: string[];
3560
- };
3444
+ }): URL;
3561
3445
  validateAuthorizationCode: ({
3562
3446
  code,
3563
3447
  redirectURI
@@ -3593,7 +3477,6 @@ declare const socialProviders: {
3593
3477
  reddit: (options: RedditOptions) => {
3594
3478
  id: "reddit";
3595
3479
  name: string;
3596
- callbackPath: string;
3597
3480
  createAuthorizationURL({
3598
3481
  state,
3599
3482
  scopes,
@@ -3608,10 +3491,7 @@ declare const socialProviders: {
3608
3491
  loginHint?: string | undefined;
3609
3492
  idTokenNonce?: string | undefined;
3610
3493
  additionalParams?: Record<string, string> | undefined;
3611
- }): Promise<{
3612
- url: URL;
3613
- requestedScopes: string[];
3614
- }>;
3494
+ }): Promise<URL>;
3615
3495
  validateAuthorizationCode: ({
3616
3496
  code,
3617
3497
  redirectURI
@@ -3647,7 +3527,6 @@ declare const socialProviders: {
3647
3527
  roblox: (options: RobloxOptions) => {
3648
3528
  id: "roblox";
3649
3529
  name: string;
3650
- callbackPath: string;
3651
3530
  createAuthorizationURL({
3652
3531
  state,
3653
3532
  scopes,
@@ -3662,10 +3541,7 @@ declare const socialProviders: {
3662
3541
  loginHint?: string | undefined;
3663
3542
  idTokenNonce?: string | undefined;
3664
3543
  additionalParams?: Record<string, string> | undefined;
3665
- }): Promise<{
3666
- url: URL;
3667
- requestedScopes: string[];
3668
- }>;
3544
+ }): Promise<URL>;
3669
3545
  validateAuthorizationCode: ({
3670
3546
  code,
3671
3547
  redirectURI
@@ -3701,7 +3577,6 @@ declare const socialProviders: {
3701
3577
  salesforce: (options: SalesforceOptions) => {
3702
3578
  id: "salesforce";
3703
3579
  name: string;
3704
- callbackPath: string;
3705
3580
  createAuthorizationURL({
3706
3581
  state,
3707
3582
  scopes,
@@ -3717,10 +3592,7 @@ declare const socialProviders: {
3717
3592
  loginHint?: string | undefined;
3718
3593
  idTokenNonce?: string | undefined;
3719
3594
  additionalParams?: Record<string, string> | undefined;
3720
- }): Promise<{
3721
- url: URL;
3722
- requestedScopes: string[];
3723
- }>;
3595
+ }): Promise<URL>;
3724
3596
  validateAuthorizationCode: ({
3725
3597
  code,
3726
3598
  codeVerifier,
@@ -3757,7 +3629,6 @@ declare const socialProviders: {
3757
3629
  vk: (options: VkOption) => {
3758
3630
  id: "vk";
3759
3631
  name: string;
3760
- callbackPath: string;
3761
3632
  createAuthorizationURL({
3762
3633
  state,
3763
3634
  scopes,
@@ -3773,10 +3644,7 @@ declare const socialProviders: {
3773
3644
  loginHint?: string | undefined;
3774
3645
  idTokenNonce?: string | undefined;
3775
3646
  additionalParams?: Record<string, string> | undefined;
3776
- }): Promise<{
3777
- url: URL;
3778
- requestedScopes: string[];
3779
- }>;
3647
+ }): Promise<URL>;
3780
3648
  validateAuthorizationCode: ({
3781
3649
  code,
3782
3650
  codeVerifier,
@@ -3814,10 +3682,8 @@ declare const socialProviders: {
3814
3682
  zoom: (userOptions: ZoomOptions) => {
3815
3683
  id: "zoom";
3816
3684
  name: string;
3817
- callbackPath: string;
3818
3685
  createAuthorizationURL: ({
3819
3686
  state,
3820
- scopes,
3821
3687
  redirectURI,
3822
3688
  codeVerifier,
3823
3689
  additionalParams
@@ -3830,10 +3696,7 @@ declare const socialProviders: {
3830
3696
  loginHint?: string | undefined;
3831
3697
  idTokenNonce?: string | undefined;
3832
3698
  additionalParams?: Record<string, string> | undefined;
3833
- }) => Promise<{
3834
- url: URL;
3835
- requestedScopes: string[];
3836
- }>;
3699
+ }) => Promise<URL>;
3837
3700
  validateAuthorizationCode: ({
3838
3701
  code,
3839
3702
  redirectURI,
@@ -3869,7 +3732,6 @@ declare const socialProviders: {
3869
3732
  notion: (options: NotionOptions) => {
3870
3733
  id: "notion";
3871
3734
  name: string;
3872
- callbackPath: string;
3873
3735
  createAuthorizationURL({
3874
3736
  state,
3875
3737
  scopes,
@@ -3885,10 +3747,7 @@ declare const socialProviders: {
3885
3747
  loginHint?: string | undefined;
3886
3748
  idTokenNonce?: string | undefined;
3887
3749
  additionalParams?: Record<string, string> | undefined;
3888
- }): Promise<{
3889
- url: URL;
3890
- requestedScopes: string[];
3891
- }>;
3750
+ }): Promise<URL>;
3892
3751
  validateAuthorizationCode: ({
3893
3752
  code,
3894
3753
  redirectURI
@@ -3924,7 +3783,6 @@ declare const socialProviders: {
3924
3783
  kakao: (options: KakaoOptions) => {
3925
3784
  id: "kakao";
3926
3785
  name: string;
3927
- callbackPath: string;
3928
3786
  createAuthorizationURL({
3929
3787
  state,
3930
3788
  scopes,
@@ -3939,10 +3797,7 @@ declare const socialProviders: {
3939
3797
  loginHint?: string | undefined;
3940
3798
  idTokenNonce?: string | undefined;
3941
3799
  additionalParams?: Record<string, string> | undefined;
3942
- }): Promise<{
3943
- url: URL;
3944
- requestedScopes: string[];
3945
- }>;
3800
+ }): Promise<URL>;
3946
3801
  validateAuthorizationCode: ({
3947
3802
  code,
3948
3803
  redirectURI
@@ -3999,7 +3854,6 @@ declare const socialProviders: {
3999
3854
  naver: (options: NaverOptions) => {
4000
3855
  id: "naver";
4001
3856
  name: string;
4002
- callbackPath: string;
4003
3857
  createAuthorizationURL({
4004
3858
  state,
4005
3859
  scopes,
@@ -4014,10 +3868,7 @@ declare const socialProviders: {
4014
3868
  loginHint?: string | undefined;
4015
3869
  idTokenNonce?: string | undefined;
4016
3870
  additionalParams?: Record<string, string> | undefined;
4017
- }): Promise<{
4018
- url: URL;
4019
- requestedScopes: string[];
4020
- }>;
3871
+ }): Promise<URL>;
4021
3872
  validateAuthorizationCode: ({
4022
3873
  code,
4023
3874
  redirectURI
@@ -4074,7 +3925,6 @@ declare const socialProviders: {
4074
3925
  line: (options: LineOptions) => {
4075
3926
  id: "line";
4076
3927
  name: string;
4077
- callbackPath: string;
4078
3928
  createAuthorizationURL({
4079
3929
  state,
4080
3930
  scopes,
@@ -4091,10 +3941,7 @@ declare const socialProviders: {
4091
3941
  loginHint?: string | undefined;
4092
3942
  idTokenNonce?: string | undefined;
4093
3943
  additionalParams?: Record<string, string> | undefined;
4094
- }): Promise<{
4095
- url: URL;
4096
- requestedScopes: string[];
4097
- }>;
3944
+ }): Promise<URL>;
4098
3945
  validateAuthorizationCode: ({
4099
3946
  code,
4100
3947
  codeVerifier,
@@ -4155,7 +4002,6 @@ declare const socialProviders: {
4155
4002
  paybin: (options: PaybinOptions) => {
4156
4003
  id: "paybin";
4157
4004
  name: string;
4158
- callbackPath: string;
4159
4005
  createAuthorizationURL({
4160
4006
  state,
4161
4007
  scopes,
@@ -4172,10 +4018,7 @@ declare const socialProviders: {
4172
4018
  loginHint?: string | undefined;
4173
4019
  idTokenNonce?: string | undefined;
4174
4020
  additionalParams?: Record<string, string> | undefined;
4175
- }): Promise<{
4176
- url: URL;
4177
- requestedScopes: string[];
4178
- }>;
4021
+ }): Promise<URL>;
4179
4022
  validateAuthorizationCode: ({
4180
4023
  code,
4181
4024
  codeVerifier,
@@ -4212,7 +4055,6 @@ declare const socialProviders: {
4212
4055
  paypal: (options: PayPalOptions) => {
4213
4056
  id: "paypal";
4214
4057
  name: string;
4215
- callbackPath: string;
4216
4058
  createAuthorizationURL({
4217
4059
  state,
4218
4060
  codeVerifier,
@@ -4227,10 +4069,7 @@ declare const socialProviders: {
4227
4069
  loginHint?: string | undefined;
4228
4070
  idTokenNonce?: string | undefined;
4229
4071
  additionalParams?: Record<string, string> | undefined;
4230
- }): Promise<{
4231
- url: URL;
4232
- requestedScopes: string[];
4233
- }>;
4072
+ }): Promise<URL>;
4234
4073
  validateAuthorizationCode: ({
4235
4074
  code,
4236
4075
  redirectURI
@@ -4296,7 +4135,6 @@ declare const socialProviders: {
4296
4135
  polar: (options: PolarOptions) => {
4297
4136
  id: "polar";
4298
4137
  name: string;
4299
- callbackPath: string;
4300
4138
  createAuthorizationURL({
4301
4139
  state,
4302
4140
  scopes,
@@ -4312,10 +4150,7 @@ declare const socialProviders: {
4312
4150
  loginHint?: string | undefined;
4313
4151
  idTokenNonce?: string | undefined;
4314
4152
  additionalParams?: Record<string, string> | undefined;
4315
- }): Promise<{
4316
- url: URL;
4317
- requestedScopes: string[];
4318
- }>;
4153
+ }): Promise<URL>;
4319
4154
  validateAuthorizationCode: ({
4320
4155
  code,
4321
4156
  codeVerifier,
@@ -4352,7 +4187,6 @@ declare const socialProviders: {
4352
4187
  railway: (options: RailwayOptions) => {
4353
4188
  id: "railway";
4354
4189
  name: string;
4355
- callbackPath: string;
4356
4190
  createAuthorizationURL({
4357
4191
  state,
4358
4192
  scopes,
@@ -4368,10 +4202,7 @@ declare const socialProviders: {
4368
4202
  loginHint?: string | undefined;
4369
4203
  idTokenNonce?: string | undefined;
4370
4204
  additionalParams?: Record<string, string> | undefined;
4371
- }): Promise<{
4372
- url: URL;
4373
- requestedScopes: string[];
4374
- }>;
4205
+ }): Promise<URL>;
4375
4206
  validateAuthorizationCode: ({
4376
4207
  code,
4377
4208
  codeVerifier,
@@ -4408,7 +4239,6 @@ declare const socialProviders: {
4408
4239
  vercel: (options: VercelOptions) => {
4409
4240
  id: "vercel";
4410
4241
  name: string;
4411
- callbackPath: string;
4412
4242
  createAuthorizationURL({
4413
4243
  state,
4414
4244
  scopes,
@@ -4424,10 +4254,7 @@ declare const socialProviders: {
4424
4254
  loginHint?: string | undefined;
4425
4255
  idTokenNonce?: string | undefined;
4426
4256
  additionalParams?: Record<string, string> | undefined;
4427
- }): Promise<{
4428
- url: URL;
4429
- requestedScopes: string[];
4430
- }>;
4257
+ }): Promise<URL>;
4431
4258
  validateAuthorizationCode: ({
4432
4259
  code,
4433
4260
  codeVerifier,
@@ -4463,7 +4290,6 @@ declare const socialProviders: {
4463
4290
  wechat: (options: WeChatOptions) => {
4464
4291
  id: "wechat";
4465
4292
  name: string;
4466
- callbackPath: string;
4467
4293
  createAuthorizationURL({
4468
4294
  state,
4469
4295
  scopes,
@@ -4478,10 +4304,7 @@ declare const socialProviders: {
4478
4304
  loginHint?: string | undefined;
4479
4305
  idTokenNonce?: string | undefined;
4480
4306
  additionalParams?: Record<string, string> | undefined;
4481
- }): {
4482
- url: URL;
4483
- requestedScopes: string[];
4484
- };
4307
+ }): URL;
4485
4308
  validateAuthorizationCode: ({
4486
4309
  code
4487
4310
  }: {
@@ -4548,7 +4371,7 @@ declare const accountSchema: z.ZodObject<{
4548
4371
  idToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4549
4372
  accessTokenExpiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
4550
4373
  refreshTokenExpiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
4551
- grantedScopes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
4374
+ scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4552
4375
  password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4553
4376
  }, z.core.$strip>;
4554
4377
  type BaseAccount = z.infer<typeof accountSchema>;
@@ -5434,6 +5257,10 @@ type GenericEndpointContext<Options extends BetterAuthOptions = BetterAuthOption
5434
5257
  context: AuthContext<Options>;
5435
5258
  };
5436
5259
  interface InternalAdapter<_Options extends BetterAuthOptions = BetterAuthOptions> {
5260
+ createOAuthUser(user: Omit<User, "id" | "createdAt" | "updatedAt">, account: Omit<Account, "userId" | "id" | "createdAt" | "updatedAt"> & Partial<Account>): Promise<{
5261
+ user: User;
5262
+ account: Account;
5263
+ }>;
5437
5264
  createUser<T extends Record<string, any>>(user: Omit<User, "id" | "createdAt" | "updatedAt" | "emailVerified"> & Partial<User> & Record<string, any>,
5438
5265
  /**
5439
5266
  * Provisioning source. The creation seam adds `action: "create-user"` and
@@ -5612,7 +5439,7 @@ type AuthContext<Options extends BetterAuthOptions = BetterAuthOptions> = Plugin
5612
5439
  session: Session & Record<string, any>;
5613
5440
  user: User & Record<string, any>;
5614
5441
  } | null) => void;
5615
- socialProviders: UpstreamProvider[];
5442
+ socialProviders: OAuthProvider[];
5616
5443
  authCookies: BetterAuthCookies;
5617
5444
  logger: ReturnType<typeof createLogger>;
5618
5445
  rateLimit: {
@@ -5778,7 +5605,7 @@ declare const createAuthMiddleware: {
5778
5605
  image?: string | null | undefined;
5779
5606
  } & Record<string, any>;
5780
5607
  } | null) => void;
5781
- socialProviders: UpstreamProvider[];
5608
+ socialProviders: OAuthProvider[];
5782
5609
  authCookies: BetterAuthCookies;
5783
5610
  logger: ReturnType<typeof createLogger>;
5784
5611
  rateLimit: {
@@ -5907,7 +5734,7 @@ declare const createAuthMiddleware: {
5907
5734
  image?: string | null | undefined;
5908
5735
  } & Record<string, any>;
5909
5736
  } | null) => void;
5910
- socialProviders: UpstreamProvider[];
5737
+ socialProviders: OAuthProvider[];
5911
5738
  authCookies: BetterAuthCookies;
5912
5739
  logger: ReturnType<typeof createLogger>;
5913
5740
  rateLimit: {
package/dist/proxy.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-DQW8cveo.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-B__xynWl.mjs";
2
2
  import { r as parseProtocolScheme } from "./utils-DxDKRT6e.mjs";
3
3
  import { parseCookies } from "better-auth/cookies";
4
4
  //#region src/proxy.ts
@@ -1,5 +1,5 @@
1
1
  //#endregion
2
2
  //#region src/version.ts
3
- const PACKAGE_VERSION = "1.7.0-beta.7";
3
+ const PACKAGE_VERSION = "1.7.0-beta.9";
4
4
  //#endregion
5
5
  export { PACKAGE_VERSION as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/electron",
3
- "version": "1.7.0-beta.7",
3
+ "version": "1.7.0-beta.9",
4
4
  "description": "Better Auth integration for Electron applications.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -80,8 +80,8 @@
80
80
  "better-sqlite3": "^12.6.2",
81
81
  "electron": "^41.2.2",
82
82
  "tsdown": "0.21.1",
83
- "@better-auth/core": "1.7.0-beta.7",
84
- "better-auth": "1.7.0-beta.7"
83
+ "@better-auth/core": "1.7.0-beta.9",
84
+ "better-auth": "1.7.0-beta.9"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "@better-auth/utils": "0.4.2",
@@ -89,8 +89,8 @@
89
89
  "better-call": "1.3.6",
90
90
  "conf": "^15.0.2",
91
91
  "electron": ">=36.0.0",
92
- "@better-auth/core": "^1.7.0-beta.7",
93
- "better-auth": "^1.7.0-beta.7"
92
+ "@better-auth/core": "^1.7.0-beta.9",
93
+ "better-auth": "^1.7.0-beta.9"
94
94
  },
95
95
  "peerDependenciesMeta": {
96
96
  "electron": {