@better-auth/electron 1.7.0-beta.5 → 1.7.0-beta.7
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 +13 -11
- package/dist/index.mjs +3 -4
- package/dist/preload.d.mts +234 -24
- package/dist/proxy.mjs +1 -1
- package/dist/{version-DzWb5tB_.mjs → version-DQW8cveo.mjs} +1 -1
- package/package.json +7 -7
package/dist/client.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-DQW8cveo.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";
|
|
@@ -578,6 +578,16 @@ const electronClient = (options) => {
|
|
|
578
578
|
const cookieName = `${opts.storagePrefix}.cookie`;
|
|
579
579
|
const localCacheName = `${opts.storagePrefix}.local_cache`;
|
|
580
580
|
const { getDecrypted, setEncrypted } = storageAdapter(opts.storage, new Set([cookieName, localCacheName]));
|
|
581
|
+
const clearSessionCache = () => {
|
|
582
|
+
setEncrypted(cookieName, "{}");
|
|
583
|
+
store?.atoms.session?.set({
|
|
584
|
+
...store.atoms.session.get(),
|
|
585
|
+
data: null,
|
|
586
|
+
error: null,
|
|
587
|
+
isPending: false
|
|
588
|
+
});
|
|
589
|
+
setEncrypted(localCacheName, "{}");
|
|
590
|
+
};
|
|
581
591
|
if ((isDevelopment() || isTest()) && /^(?!\.)(?!.*\.\.)(?!.*\.$)[^.]+\.[^.]+$/.test(scheme)) console.warn("The provided scheme does not follow the reverse domain name notation. For example: `app.example.com` -> `com.example.app`.");
|
|
582
592
|
return {
|
|
583
593
|
id: "electron",
|
|
@@ -597,16 +607,7 @@ const electronClient = (options) => {
|
|
|
597
607
|
"user-agent": app.userAgentFallback,
|
|
598
608
|
"x-skip-oauth-proxy": "true"
|
|
599
609
|
};
|
|
600
|
-
if (url.endsWith("/sign-out"))
|
|
601
|
-
setEncrypted(cookieName, "{}");
|
|
602
|
-
store?.atoms.session?.set({
|
|
603
|
-
...store.atoms.session.get(),
|
|
604
|
-
data: null,
|
|
605
|
-
error: null,
|
|
606
|
-
isPending: false
|
|
607
|
-
});
|
|
608
|
-
setEncrypted(localCacheName, "{}");
|
|
609
|
-
}
|
|
610
|
+
if (url.endsWith("/sign-out")) clearSessionCache();
|
|
610
611
|
return {
|
|
611
612
|
url,
|
|
612
613
|
options
|
|
@@ -629,6 +630,7 @@ const electronClient = (options) => {
|
|
|
629
630
|
const data = context.data;
|
|
630
631
|
setEncrypted(localCacheName, JSON.stringify(data));
|
|
631
632
|
}
|
|
633
|
+
if (context.request.url.toString().includes("/sign-out")) clearSessionCache();
|
|
632
634
|
},
|
|
633
635
|
onError: async (context) => {
|
|
634
636
|
webContents.getFocusedWebContents()?.send(`${getChannelPrefixWithDelimiter(opts.channelPrefix)}error`, {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-DQW8cveo.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";
|
|
@@ -53,14 +53,13 @@ const electronToken = (_opts) => createAuthEndpoint("/electron/token", {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}, async (ctx) => {
|
|
56
|
-
const token = await ctx.context.internalAdapter.
|
|
57
|
-
if (!token
|
|
56
|
+
const token = await ctx.context.internalAdapter.consumeVerificationValue(`electron:${ctx.body.token}`);
|
|
57
|
+
if (!token) throw APIError.from("NOT_FOUND", ELECTRON_ERROR_CODES.INVALID_TOKEN);
|
|
58
58
|
const tokenRecord = safeJSONParse$1(token.value);
|
|
59
59
|
if (!tokenRecord) throw APIError.from("INTERNAL_SERVER_ERROR", ELECTRON_ERROR_CODES.INVALID_TOKEN);
|
|
60
60
|
if (tokenRecord.state !== ctx.body.state) throw APIError.from("BAD_REQUEST", ELECTRON_ERROR_CODES.STATE_MISMATCH);
|
|
61
61
|
if (!tokenRecord.codeChallenge) throw APIError.from("BAD_REQUEST", ELECTRON_ERROR_CODES.MISSING_CODE_CHALLENGE);
|
|
62
62
|
if (await generateCodeChallenge(ctx.body.code_verifier) !== tokenRecord.codeChallenge) throw APIError.from("BAD_REQUEST", ELECTRON_ERROR_CODES.INVALID_CODE_VERIFIER);
|
|
63
|
-
await ctx.context.internalAdapter.deleteVerificationByIdentifier(`electron:${ctx.body.token}`);
|
|
64
63
|
const user = await ctx.context.internalAdapter.findUserById(tokenRecord.userId);
|
|
65
64
|
if (!user) throw APIError.from("INTERNAL_SERVER_ERROR", BASE_ERROR_CODES.USER_NOT_FOUND);
|
|
66
65
|
const session = await ctx.context.internalAdapter.createSession(user.id);
|
package/dist/preload.d.mts
CHANGED
|
@@ -33,6 +33,7 @@ type DBAdapterDebugLogOption = boolean | {
|
|
|
33
33
|
delete?: boolean | undefined;
|
|
34
34
|
deleteMany?: boolean | undefined;
|
|
35
35
|
consumeOne?: boolean | undefined;
|
|
36
|
+
incrementOne?: boolean | undefined;
|
|
36
37
|
count?: boolean | undefined;
|
|
37
38
|
} | {
|
|
38
39
|
/**
|
|
@@ -208,7 +209,7 @@ interface DBAdapterFactoryConfig<Options extends BetterAuthOptions = BetterAuthO
|
|
|
208
209
|
/**
|
|
209
210
|
* The action which was called from the adapter.
|
|
210
211
|
*/
|
|
211
|
-
action: "create" | "update" | "findOne" | "findMany" | "updateMany" | "delete" | "deleteMany" | "consumeOne" | "count";
|
|
212
|
+
action: "create" | "update" | "findOne" | "findMany" | "updateMany" | "delete" | "deleteMany" | "consumeOne" | "incrementOne" | "count";
|
|
212
213
|
/**
|
|
213
214
|
* The model name.
|
|
214
215
|
*/
|
|
@@ -437,15 +438,43 @@ type DBAdapter<Options extends BetterAuthOptions = BetterAuthOptions> = {
|
|
|
437
438
|
* race-safe primitive for consuming single-use credentials
|
|
438
439
|
* (verification tokens, authorization codes, one-time tokens).
|
|
439
440
|
*
|
|
440
|
-
* Always defined on the factory-wrapped adapter.
|
|
441
|
-
* `CustomAdapter`
|
|
442
|
-
*
|
|
443
|
-
* and returns the row only when the delete reports an affected row.
|
|
441
|
+
* Always defined on the factory-wrapped adapter. The underlying
|
|
442
|
+
* `CustomAdapter` must implement this natively; there is no portable
|
|
443
|
+
* fallback that can guarantee cross-process single-use semantics.
|
|
444
444
|
*/
|
|
445
445
|
consumeOne: <T>(data: {
|
|
446
446
|
model: string;
|
|
447
447
|
where: Where[];
|
|
448
448
|
}) => Promise<T | null>;
|
|
449
|
+
/**
|
|
450
|
+
* Atomically apply signed numeric deltas to a single row matching the where
|
|
451
|
+
* clause. For each entry in `increment`, the operation applies
|
|
452
|
+
* `field = field + delta` in one atomic step; a negative delta decrements.
|
|
453
|
+
*
|
|
454
|
+
* The `where` clause is both the selector AND the guard: comparison
|
|
455
|
+
* operators are honored, so passing `{ field: "remaining", operator: "gt",
|
|
456
|
+
* value: 0 }` only mutates the row while `remaining` is still above zero.
|
|
457
|
+
* When the guard matches no row, the operation makes no change and returns
|
|
458
|
+
* `null`.
|
|
459
|
+
*
|
|
460
|
+
* The optional `set` map assigns absolute values to fields in the same
|
|
461
|
+
* atomic operation, alongside the increments.
|
|
462
|
+
*
|
|
463
|
+
* Returns the updated row, or `null` when the guard matched no row. Under
|
|
464
|
+
* concurrent invocation against the same row, this is the race-safe
|
|
465
|
+
* primitive for guarded counter updates (e.g. decrementing a remaining-uses
|
|
466
|
+
* counter only while it is still positive).
|
|
467
|
+
*
|
|
468
|
+
* Always defined on the factory-wrapped adapter. The underlying
|
|
469
|
+
* `CustomAdapter` must implement this natively; there is no portable
|
|
470
|
+
* fallback that can guarantee guarded counter semantics across runtimes.
|
|
471
|
+
*/
|
|
472
|
+
incrementOne: <T>(data: {
|
|
473
|
+
model: string;
|
|
474
|
+
where: Where[];
|
|
475
|
+
increment: Record<string, number>;
|
|
476
|
+
set?: Record<string, unknown> | undefined;
|
|
477
|
+
}) => Promise<T | null>;
|
|
449
478
|
/**
|
|
450
479
|
* Execute multiple operations in a transaction.
|
|
451
480
|
* If the adapter doesn't support transactions, operations will be executed sequentially.
|
|
@@ -528,17 +557,32 @@ interface CustomAdapter {
|
|
|
528
557
|
where: CleanedWhere[];
|
|
529
558
|
}) => Promise<number>;
|
|
530
559
|
/**
|
|
531
|
-
*
|
|
532
|
-
* factory falls back to `transaction(findMany + deleteMany)`.
|
|
560
|
+
* Native atomic single-row consume.
|
|
533
561
|
* Implementing this method natively (e.g. `DELETE ... RETURNING *`,
|
|
534
562
|
* `findOneAndDelete`, `OUTPUT deleted.*`) gives one round trip and the
|
|
535
563
|
* strongest race-safety guarantee. Implementations must delete at most
|
|
536
|
-
* one matching row.
|
|
537
|
-
|
|
564
|
+
* one matching row.
|
|
565
|
+
*/
|
|
566
|
+
consumeOne: <T>(data: {
|
|
567
|
+
model: string;
|
|
568
|
+
where: CleanedWhere[];
|
|
569
|
+
}) => Promise<T | null>;
|
|
570
|
+
/**
|
|
571
|
+
* Native atomic guarded counter mutation. Applies
|
|
572
|
+
* `field = field + delta` for each entry in `increment` (negative deltas
|
|
573
|
+
* decrement), with `where` acting as both selector and guard and `set`
|
|
574
|
+
* assigning absolute values in the same operation. Returns the updated row,
|
|
575
|
+
* or `null` when the guard matched no row.
|
|
576
|
+
*
|
|
577
|
+
* Implementing this natively (e.g. `UPDATE ... SET n = n + $delta WHERE ...
|
|
578
|
+
* RETURNING *`) gives one round trip and the strongest race-safety
|
|
579
|
+
* guarantee.
|
|
538
580
|
*/
|
|
539
|
-
|
|
581
|
+
incrementOne: <T>(data: {
|
|
540
582
|
model: string;
|
|
541
583
|
where: CleanedWhere[];
|
|
584
|
+
increment: Record<string, number>;
|
|
585
|
+
set?: Record<string, unknown> | undefined;
|
|
542
586
|
}) => Promise<T | null>;
|
|
543
587
|
count: ({
|
|
544
588
|
model,
|
|
@@ -577,7 +621,6 @@ type BaseRateLimit = z.infer<typeof rateLimitSchema>;
|
|
|
577
621
|
/**
|
|
578
622
|
* Rate limit schema type used by better-auth for rate limiting
|
|
579
623
|
*/
|
|
580
|
-
type RateLimit<DBOptions extends BetterAuthOptions["rateLimit"] = BetterAuthOptions["rateLimit"], Plugins extends BetterAuthOptions["plugins"] = BetterAuthOptions["plugins"]> = Prettify$1<BaseRateLimit & InferDBFieldsFromOptions<DBOptions> & InferDBFieldsFromPlugins<"rateLimit", Plugins>>; //#endregion
|
|
581
624
|
//#endregion
|
|
582
625
|
//#region ../core/dist/db/schema/session.d.mts
|
|
583
626
|
//#region src/db/schema/session.d.ts
|
|
@@ -713,6 +756,17 @@ type OAuth2UserInfo = {
|
|
|
713
756
|
image?: string | undefined;
|
|
714
757
|
emailVerified: boolean;
|
|
715
758
|
};
|
|
759
|
+
/**
|
|
760
|
+
* Request metadata available to provider refresh hooks.
|
|
761
|
+
*
|
|
762
|
+
* The refresh flow may be triggered by endpoints such as `getAccessToken` or
|
|
763
|
+
* `refreshToken`; this context gives provider hooks access to the triggering
|
|
764
|
+
* request without exposing the full endpoint implementation surface.
|
|
765
|
+
*/
|
|
766
|
+
interface OAuthRefreshContext {
|
|
767
|
+
headers?: Headers | undefined;
|
|
768
|
+
request?: Request | undefined;
|
|
769
|
+
}
|
|
716
770
|
/**
|
|
717
771
|
* The result of building a provider authorization URL.
|
|
718
772
|
*
|
|
@@ -772,6 +826,12 @@ interface UpstreamProvider<T extends Record<string, any> = Record<string, any>,
|
|
|
772
826
|
redirectURI: string;
|
|
773
827
|
display?: string | undefined;
|
|
774
828
|
loginHint?: string | undefined;
|
|
829
|
+
/**
|
|
830
|
+
* OIDC nonce generated by the redirect initiator and persisted in OAuth
|
|
831
|
+
* state. Providers that set `requiresIdTokenNonce` must forward this to
|
|
832
|
+
* the authorization URL as the `nonce` parameter.
|
|
833
|
+
*/
|
|
834
|
+
idTokenNonce?: string | undefined;
|
|
775
835
|
/**
|
|
776
836
|
* Extra query parameters to append to the authorization URL.
|
|
777
837
|
* Providers forward these to the shared `createAuthorizationURL` helper,
|
|
@@ -788,6 +848,12 @@ interface UpstreamProvider<T extends Record<string, any> = Record<string, any>,
|
|
|
788
848
|
deviceId?: string | undefined;
|
|
789
849
|
}) => Promise<OAuth2Tokens | null>;
|
|
790
850
|
getUserInfo: (token: OAuth2Tokens & {
|
|
851
|
+
/**
|
|
852
|
+
* OIDC nonce recovered from OAuth state. Providers that required an
|
|
853
|
+
* ID-token nonce must pass this to `verifyProviderIdToken` before
|
|
854
|
+
* trusting ID-token claims.
|
|
855
|
+
*/
|
|
856
|
+
expectedIdTokenNonce?: string | undefined;
|
|
791
857
|
/**
|
|
792
858
|
* The user object from the provider
|
|
793
859
|
* This is only available for some providers like Apple
|
|
@@ -804,9 +870,13 @@ interface UpstreamProvider<T extends Record<string, any> = Record<string, any>,
|
|
|
804
870
|
data: T;
|
|
805
871
|
} | null>;
|
|
806
872
|
/**
|
|
807
|
-
* Custom function to refresh a token
|
|
873
|
+
* Custom function to refresh a token.
|
|
874
|
+
*
|
|
875
|
+
* Receives request metadata from the endpoint that triggered the refresh.
|
|
876
|
+
* Providers that don't need request-scoped data can ignore the second
|
|
877
|
+
* argument.
|
|
808
878
|
*/
|
|
809
|
-
refreshAccessToken?: ((refreshToken: string) => Promise<OAuth2Tokens>) | undefined;
|
|
879
|
+
refreshAccessToken?: ((refreshToken: string, ctx?: OAuthRefreshContext) => Promise<OAuth2Tokens>) | undefined;
|
|
810
880
|
/**
|
|
811
881
|
* Declarative id_token verification config consumed by the shared
|
|
812
882
|
* `verifyProviderIdToken` verifier. Providers set this instead of implementing a boolean
|
|
@@ -819,6 +889,13 @@ interface UpstreamProvider<T extends Record<string, any> = Record<string, any>,
|
|
|
819
889
|
* against this value to prevent authorization server mix-up attacks.
|
|
820
890
|
*/
|
|
821
891
|
issuer?: string | undefined;
|
|
892
|
+
/**
|
|
893
|
+
* Require shared OAuth redirect routes to bind ID-token verification to an
|
|
894
|
+
* authorization request nonce. When true, routes generate `idTokenNonce`,
|
|
895
|
+
* pass it to `createAuthorizationURL`, persist it in state, and provide it
|
|
896
|
+
* back to `getUserInfo` as `expectedIdTokenNonce`.
|
|
897
|
+
*/
|
|
898
|
+
requiresIdTokenNonce?: boolean | undefined;
|
|
822
899
|
/**
|
|
823
900
|
* Disable implicit sign up for new users. When set to true for the provider,
|
|
824
901
|
* sign-in need to be called with with requestSignUp as true to create new users.
|
|
@@ -2366,6 +2443,7 @@ declare const socialProviders: {
|
|
|
2366
2443
|
redirectURI: string;
|
|
2367
2444
|
display?: string | undefined;
|
|
2368
2445
|
loginHint?: string | undefined;
|
|
2446
|
+
idTokenNonce?: string | undefined;
|
|
2369
2447
|
additionalParams?: Record<string, string> | undefined;
|
|
2370
2448
|
}): Promise<{
|
|
2371
2449
|
url: URL;
|
|
@@ -2390,6 +2468,7 @@ declare const socialProviders: {
|
|
|
2390
2468
|
};
|
|
2391
2469
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
2392
2470
|
getUserInfo(token: OAuth2Tokens & {
|
|
2471
|
+
expectedIdTokenNonce?: string | undefined;
|
|
2393
2472
|
user?: {
|
|
2394
2473
|
name?: {
|
|
2395
2474
|
firstName?: string;
|
|
@@ -2427,6 +2506,7 @@ declare const socialProviders: {
|
|
|
2427
2506
|
redirectURI: string;
|
|
2428
2507
|
display?: string | undefined;
|
|
2429
2508
|
loginHint?: string | undefined;
|
|
2509
|
+
idTokenNonce?: string | undefined;
|
|
2430
2510
|
additionalParams?: Record<string, string> | undefined;
|
|
2431
2511
|
}): Promise<{
|
|
2432
2512
|
url: URL;
|
|
@@ -2444,6 +2524,7 @@ declare const socialProviders: {
|
|
|
2444
2524
|
}) => Promise<OAuth2Tokens>;
|
|
2445
2525
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
2446
2526
|
getUserInfo(token: OAuth2Tokens & {
|
|
2527
|
+
expectedIdTokenNonce?: string | undefined;
|
|
2447
2528
|
user?: {
|
|
2448
2529
|
name?: {
|
|
2449
2530
|
firstName?: string;
|
|
@@ -2481,6 +2562,7 @@ declare const socialProviders: {
|
|
|
2481
2562
|
redirectURI: string;
|
|
2482
2563
|
display?: string | undefined;
|
|
2483
2564
|
loginHint?: string | undefined;
|
|
2565
|
+
idTokenNonce?: string | undefined;
|
|
2484
2566
|
additionalParams?: Record<string, string> | undefined;
|
|
2485
2567
|
}): Promise<{
|
|
2486
2568
|
url: URL;
|
|
@@ -2504,6 +2586,7 @@ declare const socialProviders: {
|
|
|
2504
2586
|
maxTokenAge: string;
|
|
2505
2587
|
};
|
|
2506
2588
|
getUserInfo(token: OAuth2Tokens & {
|
|
2589
|
+
expectedIdTokenNonce?: string | undefined;
|
|
2507
2590
|
user?: {
|
|
2508
2591
|
name?: {
|
|
2509
2592
|
firstName?: string;
|
|
@@ -2540,6 +2623,7 @@ declare const socialProviders: {
|
|
|
2540
2623
|
redirectURI: string;
|
|
2541
2624
|
display?: string | undefined;
|
|
2542
2625
|
loginHint?: string | undefined;
|
|
2626
|
+
idTokenNonce?: string | undefined;
|
|
2543
2627
|
additionalParams?: Record<string, string> | undefined;
|
|
2544
2628
|
}): Promise<{
|
|
2545
2629
|
url: URL;
|
|
@@ -2556,6 +2640,7 @@ declare const socialProviders: {
|
|
|
2556
2640
|
}) => Promise<OAuth2Tokens>;
|
|
2557
2641
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
2558
2642
|
getUserInfo(token: OAuth2Tokens & {
|
|
2643
|
+
expectedIdTokenNonce?: string | undefined;
|
|
2559
2644
|
user?: {
|
|
2560
2645
|
name?: {
|
|
2561
2646
|
firstName?: string;
|
|
@@ -2593,6 +2678,7 @@ declare const socialProviders: {
|
|
|
2593
2678
|
redirectURI: string;
|
|
2594
2679
|
display?: string | undefined;
|
|
2595
2680
|
loginHint?: string | undefined;
|
|
2681
|
+
idTokenNonce?: string | undefined;
|
|
2596
2682
|
additionalParams?: Record<string, string> | undefined;
|
|
2597
2683
|
}): Promise<{
|
|
2598
2684
|
url: URL;
|
|
@@ -2623,6 +2709,7 @@ declare const socialProviders: {
|
|
|
2623
2709
|
};
|
|
2624
2710
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
2625
2711
|
getUserInfo(token: OAuth2Tokens & {
|
|
2712
|
+
expectedIdTokenNonce?: string | undefined;
|
|
2626
2713
|
user?: {
|
|
2627
2714
|
name?: {
|
|
2628
2715
|
firstName?: string;
|
|
@@ -2660,6 +2747,7 @@ declare const socialProviders: {
|
|
|
2660
2747
|
redirectURI: string;
|
|
2661
2748
|
display?: string | undefined;
|
|
2662
2749
|
loginHint?: string | undefined;
|
|
2750
|
+
idTokenNonce?: string | undefined;
|
|
2663
2751
|
additionalParams?: Record<string, string> | undefined;
|
|
2664
2752
|
}): Promise<{
|
|
2665
2753
|
url: URL;
|
|
@@ -2677,6 +2765,7 @@ declare const socialProviders: {
|
|
|
2677
2765
|
}) => Promise<OAuth2Tokens>;
|
|
2678
2766
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
2679
2767
|
getUserInfo(token: OAuth2Tokens & {
|
|
2768
|
+
expectedIdTokenNonce?: string | undefined;
|
|
2680
2769
|
user?: {
|
|
2681
2770
|
name?: {
|
|
2682
2771
|
firstName?: string;
|
|
@@ -2715,6 +2804,7 @@ declare const socialProviders: {
|
|
|
2715
2804
|
redirectURI: string;
|
|
2716
2805
|
display?: string | undefined;
|
|
2717
2806
|
loginHint?: string | undefined;
|
|
2807
|
+
idTokenNonce?: string | undefined;
|
|
2718
2808
|
additionalParams?: Record<string, string> | undefined;
|
|
2719
2809
|
}): Promise<{
|
|
2720
2810
|
url: URL;
|
|
@@ -2732,6 +2822,7 @@ declare const socialProviders: {
|
|
|
2732
2822
|
}) => Promise<OAuth2Tokens | null>;
|
|
2733
2823
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
2734
2824
|
getUserInfo(token: OAuth2Tokens & {
|
|
2825
|
+
expectedIdTokenNonce?: string | undefined;
|
|
2735
2826
|
user?: {
|
|
2736
2827
|
name?: {
|
|
2737
2828
|
firstName?: string;
|
|
@@ -2763,6 +2854,7 @@ declare const socialProviders: {
|
|
|
2763
2854
|
redirectURI: string;
|
|
2764
2855
|
display?: string | undefined;
|
|
2765
2856
|
loginHint?: string | undefined;
|
|
2857
|
+
idTokenNonce?: string | undefined;
|
|
2766
2858
|
additionalParams?: Record<string, string> | undefined;
|
|
2767
2859
|
}): Promise<{
|
|
2768
2860
|
url: URL;
|
|
@@ -2783,8 +2875,10 @@ declare const socialProviders: {
|
|
|
2783
2875
|
audience: string | string[];
|
|
2784
2876
|
maxTokenAge: string;
|
|
2785
2877
|
issuer: string | undefined;
|
|
2878
|
+
verifyClaims: (claims: Record<string, unknown>) => boolean;
|
|
2786
2879
|
};
|
|
2787
2880
|
getUserInfo(token: OAuth2Tokens & {
|
|
2881
|
+
expectedIdTokenNonce?: string | undefined;
|
|
2788
2882
|
user?: {
|
|
2789
2883
|
name?: {
|
|
2790
2884
|
firstName?: string;
|
|
@@ -2826,6 +2920,7 @@ declare const socialProviders: {
|
|
|
2826
2920
|
redirectURI: string;
|
|
2827
2921
|
display?: string | undefined;
|
|
2828
2922
|
loginHint?: string | undefined;
|
|
2923
|
+
idTokenNonce?: string | undefined;
|
|
2829
2924
|
additionalParams?: Record<string, string> | undefined;
|
|
2830
2925
|
}): Promise<{
|
|
2831
2926
|
url: URL;
|
|
@@ -2850,6 +2945,7 @@ declare const socialProviders: {
|
|
|
2850
2945
|
verifyClaims: ((claims: Record<string, unknown>) => boolean) | undefined;
|
|
2851
2946
|
};
|
|
2852
2947
|
getUserInfo(token: OAuth2Tokens & {
|
|
2948
|
+
expectedIdTokenNonce?: string | undefined;
|
|
2853
2949
|
user?: {
|
|
2854
2950
|
name?: {
|
|
2855
2951
|
firstName?: string;
|
|
@@ -2887,6 +2983,7 @@ declare const socialProviders: {
|
|
|
2887
2983
|
redirectURI: string;
|
|
2888
2984
|
display?: string | undefined;
|
|
2889
2985
|
loginHint?: string | undefined;
|
|
2986
|
+
idTokenNonce?: string | undefined;
|
|
2890
2987
|
additionalParams?: Record<string, string> | undefined;
|
|
2891
2988
|
}): Promise<{
|
|
2892
2989
|
url: URL;
|
|
@@ -2904,6 +3001,7 @@ declare const socialProviders: {
|
|
|
2904
3001
|
}) => Promise<OAuth2Tokens>;
|
|
2905
3002
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
2906
3003
|
getUserInfo(token: OAuth2Tokens & {
|
|
3004
|
+
expectedIdTokenNonce?: string | undefined;
|
|
2907
3005
|
user?: {
|
|
2908
3006
|
name?: {
|
|
2909
3007
|
firstName?: string;
|
|
@@ -2940,6 +3038,7 @@ declare const socialProviders: {
|
|
|
2940
3038
|
redirectURI: string;
|
|
2941
3039
|
display?: string | undefined;
|
|
2942
3040
|
loginHint?: string | undefined;
|
|
3041
|
+
idTokenNonce?: string | undefined;
|
|
2943
3042
|
additionalParams?: Record<string, string> | undefined;
|
|
2944
3043
|
}): Promise<{
|
|
2945
3044
|
url: URL;
|
|
@@ -2956,6 +3055,7 @@ declare const socialProviders: {
|
|
|
2956
3055
|
}) => Promise<OAuth2Tokens>;
|
|
2957
3056
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
2958
3057
|
getUserInfo(token: OAuth2Tokens & {
|
|
3058
|
+
expectedIdTokenNonce?: string | undefined;
|
|
2959
3059
|
user?: {
|
|
2960
3060
|
name?: {
|
|
2961
3061
|
firstName?: string;
|
|
@@ -2993,6 +3093,7 @@ declare const socialProviders: {
|
|
|
2993
3093
|
redirectURI: string;
|
|
2994
3094
|
display?: string | undefined;
|
|
2995
3095
|
loginHint?: string | undefined;
|
|
3096
|
+
idTokenNonce?: string | undefined;
|
|
2996
3097
|
additionalParams?: Record<string, string> | undefined;
|
|
2997
3098
|
}): Promise<{
|
|
2998
3099
|
url: URL;
|
|
@@ -3010,6 +3111,7 @@ declare const socialProviders: {
|
|
|
3010
3111
|
}) => Promise<OAuth2Tokens>;
|
|
3011
3112
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3012
3113
|
getUserInfo(token: OAuth2Tokens & {
|
|
3114
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3013
3115
|
user?: {
|
|
3014
3116
|
name?: {
|
|
3015
3117
|
firstName?: string;
|
|
@@ -3046,6 +3148,7 @@ declare const socialProviders: {
|
|
|
3046
3148
|
redirectURI: string;
|
|
3047
3149
|
display?: string | undefined;
|
|
3048
3150
|
loginHint?: string | undefined;
|
|
3151
|
+
idTokenNonce?: string | undefined;
|
|
3049
3152
|
additionalParams?: Record<string, string> | undefined;
|
|
3050
3153
|
}): Promise<{
|
|
3051
3154
|
url: URL;
|
|
@@ -3062,6 +3165,7 @@ declare const socialProviders: {
|
|
|
3062
3165
|
}) => Promise<OAuth2Tokens>;
|
|
3063
3166
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3064
3167
|
getUserInfo(token: OAuth2Tokens & {
|
|
3168
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3065
3169
|
user?: {
|
|
3066
3170
|
name?: {
|
|
3067
3171
|
firstName?: string;
|
|
@@ -3093,6 +3197,7 @@ declare const socialProviders: {
|
|
|
3093
3197
|
redirectURI: string;
|
|
3094
3198
|
display?: string | undefined;
|
|
3095
3199
|
loginHint?: string | undefined;
|
|
3200
|
+
idTokenNonce?: string | undefined;
|
|
3096
3201
|
additionalParams?: Record<string, string> | undefined;
|
|
3097
3202
|
}): Promise<{
|
|
3098
3203
|
url: URL;
|
|
@@ -3110,6 +3215,7 @@ declare const socialProviders: {
|
|
|
3110
3215
|
}) => Promise<OAuth2Tokens>;
|
|
3111
3216
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3112
3217
|
getUserInfo(token: OAuth2Tokens & {
|
|
3218
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3113
3219
|
user?: {
|
|
3114
3220
|
name?: {
|
|
3115
3221
|
firstName?: string;
|
|
@@ -3147,6 +3253,7 @@ declare const socialProviders: {
|
|
|
3147
3253
|
redirectURI: string;
|
|
3148
3254
|
display?: string | undefined;
|
|
3149
3255
|
loginHint?: string | undefined;
|
|
3256
|
+
idTokenNonce?: string | undefined;
|
|
3150
3257
|
additionalParams?: Record<string, string> | undefined;
|
|
3151
3258
|
}) => Promise<{
|
|
3152
3259
|
url: URL;
|
|
@@ -3164,6 +3271,7 @@ declare const socialProviders: {
|
|
|
3164
3271
|
}) => Promise<OAuth2Tokens>;
|
|
3165
3272
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3166
3273
|
getUserInfo(token: OAuth2Tokens & {
|
|
3274
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3167
3275
|
user?: {
|
|
3168
3276
|
name?: {
|
|
3169
3277
|
firstName?: string;
|
|
@@ -3201,6 +3309,7 @@ declare const socialProviders: {
|
|
|
3201
3309
|
redirectURI: string;
|
|
3202
3310
|
display?: string | undefined;
|
|
3203
3311
|
loginHint?: string | undefined;
|
|
3312
|
+
idTokenNonce?: string | undefined;
|
|
3204
3313
|
additionalParams?: Record<string, string> | undefined;
|
|
3205
3314
|
}): Promise<{
|
|
3206
3315
|
url: URL;
|
|
@@ -3218,6 +3327,7 @@ declare const socialProviders: {
|
|
|
3218
3327
|
}): Promise<OAuth2Tokens>;
|
|
3219
3328
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3220
3329
|
getUserInfo(token: OAuth2Tokens & {
|
|
3330
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3221
3331
|
user?: {
|
|
3222
3332
|
name?: {
|
|
3223
3333
|
firstName?: string;
|
|
@@ -3255,6 +3365,7 @@ declare const socialProviders: {
|
|
|
3255
3365
|
redirectURI: string;
|
|
3256
3366
|
display?: string | undefined;
|
|
3257
3367
|
loginHint?: string | undefined;
|
|
3368
|
+
idTokenNonce?: string | undefined;
|
|
3258
3369
|
additionalParams?: Record<string, string> | undefined;
|
|
3259
3370
|
}): Promise<{
|
|
3260
3371
|
url: URL;
|
|
@@ -3271,6 +3382,7 @@ declare const socialProviders: {
|
|
|
3271
3382
|
}) => Promise<OAuth2Tokens>;
|
|
3272
3383
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3273
3384
|
getUserInfo(token: OAuth2Tokens & {
|
|
3385
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3274
3386
|
user?: {
|
|
3275
3387
|
name?: {
|
|
3276
3388
|
firstName?: string;
|
|
@@ -3308,6 +3420,7 @@ declare const socialProviders: {
|
|
|
3308
3420
|
redirectURI: string;
|
|
3309
3421
|
display?: string | undefined;
|
|
3310
3422
|
loginHint?: string | undefined;
|
|
3423
|
+
idTokenNonce?: string | undefined;
|
|
3311
3424
|
additionalParams?: Record<string, string> | undefined;
|
|
3312
3425
|
}) => Promise<{
|
|
3313
3426
|
url: URL;
|
|
@@ -3324,6 +3437,7 @@ declare const socialProviders: {
|
|
|
3324
3437
|
}) => Promise<OAuth2Tokens>;
|
|
3325
3438
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3326
3439
|
getUserInfo(token: OAuth2Tokens & {
|
|
3440
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3327
3441
|
user?: {
|
|
3328
3442
|
name?: {
|
|
3329
3443
|
firstName?: string;
|
|
@@ -3362,6 +3476,7 @@ declare const socialProviders: {
|
|
|
3362
3476
|
redirectURI: string;
|
|
3363
3477
|
display?: string | undefined;
|
|
3364
3478
|
loginHint?: string | undefined;
|
|
3479
|
+
idTokenNonce?: string | undefined;
|
|
3365
3480
|
additionalParams?: Record<string, string> | undefined;
|
|
3366
3481
|
}) => Promise<{
|
|
3367
3482
|
url: URL;
|
|
@@ -3379,6 +3494,7 @@ declare const socialProviders: {
|
|
|
3379
3494
|
}) => Promise<OAuth2Tokens>;
|
|
3380
3495
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3381
3496
|
getUserInfo(token: OAuth2Tokens & {
|
|
3497
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3382
3498
|
user?: {
|
|
3383
3499
|
name?: {
|
|
3384
3500
|
firstName?: string;
|
|
@@ -3436,6 +3552,7 @@ declare const socialProviders: {
|
|
|
3436
3552
|
redirectURI: string;
|
|
3437
3553
|
display?: string | undefined;
|
|
3438
3554
|
loginHint?: string | undefined;
|
|
3555
|
+
idTokenNonce?: string | undefined;
|
|
3439
3556
|
additionalParams?: Record<string, string> | undefined;
|
|
3440
3557
|
}): {
|
|
3441
3558
|
url: URL;
|
|
@@ -3452,6 +3569,7 @@ declare const socialProviders: {
|
|
|
3452
3569
|
}) => Promise<OAuth2Tokens>;
|
|
3453
3570
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3454
3571
|
getUserInfo(token: OAuth2Tokens & {
|
|
3572
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3455
3573
|
user?: {
|
|
3456
3574
|
name?: {
|
|
3457
3575
|
firstName?: string;
|
|
@@ -3488,6 +3606,7 @@ declare const socialProviders: {
|
|
|
3488
3606
|
redirectURI: string;
|
|
3489
3607
|
display?: string | undefined;
|
|
3490
3608
|
loginHint?: string | undefined;
|
|
3609
|
+
idTokenNonce?: string | undefined;
|
|
3491
3610
|
additionalParams?: Record<string, string> | undefined;
|
|
3492
3611
|
}): Promise<{
|
|
3493
3612
|
url: URL;
|
|
@@ -3504,6 +3623,7 @@ declare const socialProviders: {
|
|
|
3504
3623
|
}) => Promise<OAuth2Tokens>;
|
|
3505
3624
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3506
3625
|
getUserInfo(token: OAuth2Tokens & {
|
|
3626
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3507
3627
|
user?: {
|
|
3508
3628
|
name?: {
|
|
3509
3629
|
firstName?: string;
|
|
@@ -3540,6 +3660,7 @@ declare const socialProviders: {
|
|
|
3540
3660
|
redirectURI: string;
|
|
3541
3661
|
display?: string | undefined;
|
|
3542
3662
|
loginHint?: string | undefined;
|
|
3663
|
+
idTokenNonce?: string | undefined;
|
|
3543
3664
|
additionalParams?: Record<string, string> | undefined;
|
|
3544
3665
|
}): Promise<{
|
|
3545
3666
|
url: URL;
|
|
@@ -3556,6 +3677,7 @@ declare const socialProviders: {
|
|
|
3556
3677
|
}) => Promise<OAuth2Tokens>;
|
|
3557
3678
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3558
3679
|
getUserInfo(token: OAuth2Tokens & {
|
|
3680
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3559
3681
|
user?: {
|
|
3560
3682
|
name?: {
|
|
3561
3683
|
firstName?: string;
|
|
@@ -3593,6 +3715,7 @@ declare const socialProviders: {
|
|
|
3593
3715
|
redirectURI: string;
|
|
3594
3716
|
display?: string | undefined;
|
|
3595
3717
|
loginHint?: string | undefined;
|
|
3718
|
+
idTokenNonce?: string | undefined;
|
|
3596
3719
|
additionalParams?: Record<string, string> | undefined;
|
|
3597
3720
|
}): Promise<{
|
|
3598
3721
|
url: URL;
|
|
@@ -3610,6 +3733,7 @@ declare const socialProviders: {
|
|
|
3610
3733
|
}) => Promise<OAuth2Tokens>;
|
|
3611
3734
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3612
3735
|
getUserInfo(token: OAuth2Tokens & {
|
|
3736
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3613
3737
|
user?: {
|
|
3614
3738
|
name?: {
|
|
3615
3739
|
firstName?: string;
|
|
@@ -3647,6 +3771,7 @@ declare const socialProviders: {
|
|
|
3647
3771
|
redirectURI: string;
|
|
3648
3772
|
display?: string | undefined;
|
|
3649
3773
|
loginHint?: string | undefined;
|
|
3774
|
+
idTokenNonce?: string | undefined;
|
|
3650
3775
|
additionalParams?: Record<string, string> | undefined;
|
|
3651
3776
|
}): Promise<{
|
|
3652
3777
|
url: URL;
|
|
@@ -3665,6 +3790,7 @@ declare const socialProviders: {
|
|
|
3665
3790
|
}) => Promise<OAuth2Tokens>;
|
|
3666
3791
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3667
3792
|
getUserInfo(data: OAuth2Tokens & {
|
|
3793
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3668
3794
|
user?: {
|
|
3669
3795
|
name?: {
|
|
3670
3796
|
firstName?: string;
|
|
@@ -3702,6 +3828,7 @@ declare const socialProviders: {
|
|
|
3702
3828
|
redirectURI: string;
|
|
3703
3829
|
display?: string | undefined;
|
|
3704
3830
|
loginHint?: string | undefined;
|
|
3831
|
+
idTokenNonce?: string | undefined;
|
|
3705
3832
|
additionalParams?: Record<string, string> | undefined;
|
|
3706
3833
|
}) => Promise<{
|
|
3707
3834
|
url: URL;
|
|
@@ -3719,6 +3846,7 @@ declare const socialProviders: {
|
|
|
3719
3846
|
}) => Promise<OAuth2Tokens>;
|
|
3720
3847
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3721
3848
|
getUserInfo(token: OAuth2Tokens & {
|
|
3849
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3722
3850
|
user?: {
|
|
3723
3851
|
name?: {
|
|
3724
3852
|
firstName?: string;
|
|
@@ -3755,6 +3883,7 @@ declare const socialProviders: {
|
|
|
3755
3883
|
redirectURI: string;
|
|
3756
3884
|
display?: string | undefined;
|
|
3757
3885
|
loginHint?: string | undefined;
|
|
3886
|
+
idTokenNonce?: string | undefined;
|
|
3758
3887
|
additionalParams?: Record<string, string> | undefined;
|
|
3759
3888
|
}): Promise<{
|
|
3760
3889
|
url: URL;
|
|
@@ -3771,6 +3900,7 @@ declare const socialProviders: {
|
|
|
3771
3900
|
}) => Promise<OAuth2Tokens>;
|
|
3772
3901
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3773
3902
|
getUserInfo(token: OAuth2Tokens & {
|
|
3903
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3774
3904
|
user?: {
|
|
3775
3905
|
name?: {
|
|
3776
3906
|
firstName?: string;
|
|
@@ -3807,6 +3937,7 @@ declare const socialProviders: {
|
|
|
3807
3937
|
redirectURI: string;
|
|
3808
3938
|
display?: string | undefined;
|
|
3809
3939
|
loginHint?: string | undefined;
|
|
3940
|
+
idTokenNonce?: string | undefined;
|
|
3810
3941
|
additionalParams?: Record<string, string> | undefined;
|
|
3811
3942
|
}): Promise<{
|
|
3812
3943
|
url: URL;
|
|
@@ -3823,6 +3954,7 @@ declare const socialProviders: {
|
|
|
3823
3954
|
}) => Promise<OAuth2Tokens>;
|
|
3824
3955
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3825
3956
|
getUserInfo(token: OAuth2Tokens & {
|
|
3957
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3826
3958
|
user?: {
|
|
3827
3959
|
name?: {
|
|
3828
3960
|
firstName?: string;
|
|
@@ -3880,6 +4012,7 @@ declare const socialProviders: {
|
|
|
3880
4012
|
redirectURI: string;
|
|
3881
4013
|
display?: string | undefined;
|
|
3882
4014
|
loginHint?: string | undefined;
|
|
4015
|
+
idTokenNonce?: string | undefined;
|
|
3883
4016
|
additionalParams?: Record<string, string> | undefined;
|
|
3884
4017
|
}): Promise<{
|
|
3885
4018
|
url: URL;
|
|
@@ -3896,6 +4029,7 @@ declare const socialProviders: {
|
|
|
3896
4029
|
}) => Promise<OAuth2Tokens>;
|
|
3897
4030
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
3898
4031
|
getUserInfo(token: OAuth2Tokens & {
|
|
4032
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3899
4033
|
user?: {
|
|
3900
4034
|
name?: {
|
|
3901
4035
|
firstName?: string;
|
|
@@ -3955,6 +4089,7 @@ declare const socialProviders: {
|
|
|
3955
4089
|
redirectURI: string;
|
|
3956
4090
|
display?: string | undefined;
|
|
3957
4091
|
loginHint?: string | undefined;
|
|
4092
|
+
idTokenNonce?: string | undefined;
|
|
3958
4093
|
additionalParams?: Record<string, string> | undefined;
|
|
3959
4094
|
}): Promise<{
|
|
3960
4095
|
url: URL;
|
|
@@ -3975,6 +4110,7 @@ declare const socialProviders: {
|
|
|
3975
4110
|
verify: (token: string, nonce: string | undefined) => Promise<boolean>;
|
|
3976
4111
|
};
|
|
3977
4112
|
getUserInfo(token: OAuth2Tokens & {
|
|
4113
|
+
expectedIdTokenNonce?: string | undefined;
|
|
3978
4114
|
user?: {
|
|
3979
4115
|
name?: {
|
|
3980
4116
|
firstName?: string;
|
|
@@ -4034,6 +4170,7 @@ declare const socialProviders: {
|
|
|
4034
4170
|
redirectURI: string;
|
|
4035
4171
|
display?: string | undefined;
|
|
4036
4172
|
loginHint?: string | undefined;
|
|
4173
|
+
idTokenNonce?: string | undefined;
|
|
4037
4174
|
additionalParams?: Record<string, string> | undefined;
|
|
4038
4175
|
}): Promise<{
|
|
4039
4176
|
url: URL;
|
|
@@ -4051,6 +4188,7 @@ declare const socialProviders: {
|
|
|
4051
4188
|
}) => Promise<OAuth2Tokens>;
|
|
4052
4189
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
4053
4190
|
getUserInfo(token: OAuth2Tokens & {
|
|
4191
|
+
expectedIdTokenNonce?: string | undefined;
|
|
4054
4192
|
user?: {
|
|
4055
4193
|
name?: {
|
|
4056
4194
|
firstName?: string;
|
|
@@ -4087,6 +4225,7 @@ declare const socialProviders: {
|
|
|
4087
4225
|
redirectURI: string;
|
|
4088
4226
|
display?: string | undefined;
|
|
4089
4227
|
loginHint?: string | undefined;
|
|
4228
|
+
idTokenNonce?: string | undefined;
|
|
4090
4229
|
additionalParams?: Record<string, string> | undefined;
|
|
4091
4230
|
}): Promise<{
|
|
4092
4231
|
url: URL;
|
|
@@ -4112,6 +4251,7 @@ declare const socialProviders: {
|
|
|
4112
4251
|
accessTokenExpiresAt: Date | undefined;
|
|
4113
4252
|
}>);
|
|
4114
4253
|
getUserInfo(token: OAuth2Tokens & {
|
|
4254
|
+
expectedIdTokenNonce?: string | undefined;
|
|
4115
4255
|
user?: {
|
|
4116
4256
|
name?: {
|
|
4117
4257
|
firstName?: string;
|
|
@@ -4170,6 +4310,7 @@ declare const socialProviders: {
|
|
|
4170
4310
|
redirectURI: string;
|
|
4171
4311
|
display?: string | undefined;
|
|
4172
4312
|
loginHint?: string | undefined;
|
|
4313
|
+
idTokenNonce?: string | undefined;
|
|
4173
4314
|
additionalParams?: Record<string, string> | undefined;
|
|
4174
4315
|
}): Promise<{
|
|
4175
4316
|
url: URL;
|
|
@@ -4187,6 +4328,7 @@ declare const socialProviders: {
|
|
|
4187
4328
|
}) => Promise<OAuth2Tokens>;
|
|
4188
4329
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
4189
4330
|
getUserInfo(token: OAuth2Tokens & {
|
|
4331
|
+
expectedIdTokenNonce?: string | undefined;
|
|
4190
4332
|
user?: {
|
|
4191
4333
|
name?: {
|
|
4192
4334
|
firstName?: string;
|
|
@@ -4224,6 +4366,7 @@ declare const socialProviders: {
|
|
|
4224
4366
|
redirectURI: string;
|
|
4225
4367
|
display?: string | undefined;
|
|
4226
4368
|
loginHint?: string | undefined;
|
|
4369
|
+
idTokenNonce?: string | undefined;
|
|
4227
4370
|
additionalParams?: Record<string, string> | undefined;
|
|
4228
4371
|
}): Promise<{
|
|
4229
4372
|
url: URL;
|
|
@@ -4241,6 +4384,7 @@ declare const socialProviders: {
|
|
|
4241
4384
|
}) => Promise<OAuth2Tokens>;
|
|
4242
4385
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
4243
4386
|
getUserInfo(token: OAuth2Tokens & {
|
|
4387
|
+
expectedIdTokenNonce?: string | undefined;
|
|
4244
4388
|
user?: {
|
|
4245
4389
|
name?: {
|
|
4246
4390
|
firstName?: string;
|
|
@@ -4278,6 +4422,7 @@ declare const socialProviders: {
|
|
|
4278
4422
|
redirectURI: string;
|
|
4279
4423
|
display?: string | undefined;
|
|
4280
4424
|
loginHint?: string | undefined;
|
|
4425
|
+
idTokenNonce?: string | undefined;
|
|
4281
4426
|
additionalParams?: Record<string, string> | undefined;
|
|
4282
4427
|
}): Promise<{
|
|
4283
4428
|
url: URL;
|
|
@@ -4294,6 +4439,7 @@ declare const socialProviders: {
|
|
|
4294
4439
|
deviceId?: string | undefined;
|
|
4295
4440
|
}) => Promise<OAuth2Tokens>;
|
|
4296
4441
|
getUserInfo(token: OAuth2Tokens & {
|
|
4442
|
+
expectedIdTokenNonce?: string | undefined;
|
|
4297
4443
|
user?: {
|
|
4298
4444
|
name?: {
|
|
4299
4445
|
firstName?: string;
|
|
@@ -4330,6 +4476,7 @@ declare const socialProviders: {
|
|
|
4330
4476
|
redirectURI: string;
|
|
4331
4477
|
display?: string | undefined;
|
|
4332
4478
|
loginHint?: string | undefined;
|
|
4479
|
+
idTokenNonce?: string | undefined;
|
|
4333
4480
|
additionalParams?: Record<string, string> | undefined;
|
|
4334
4481
|
}): {
|
|
4335
4482
|
url: URL;
|
|
@@ -4359,6 +4506,7 @@ declare const socialProviders: {
|
|
|
4359
4506
|
scopes: string[];
|
|
4360
4507
|
}>);
|
|
4361
4508
|
getUserInfo(token: OAuth2Tokens & {
|
|
4509
|
+
expectedIdTokenNonce?: string | undefined;
|
|
4362
4510
|
user?: {
|
|
4363
4511
|
name?: {
|
|
4364
4512
|
firstName?: string;
|
|
@@ -5368,6 +5516,23 @@ interface InternalAdapter<_Options extends BetterAuthOptions = BetterAuthOptions
|
|
|
5368
5516
|
* pair at single-use credential consumption sites.
|
|
5369
5517
|
*/
|
|
5370
5518
|
consumeVerificationValue(identifier: string): Promise<Verification | null>;
|
|
5519
|
+
/**
|
|
5520
|
+
* First-writer-wins create keyed by a deterministic primary key derived from
|
|
5521
|
+
* `identifier`. Returns `true` when this caller created the row and `false`
|
|
5522
|
+
* when a row for the same identifier already existed.
|
|
5523
|
+
*
|
|
5524
|
+
* The dual of `consumeVerificationValue`: reserve races to create a marker
|
|
5525
|
+
* exactly once, where consume races to delete one exactly once. Use it for
|
|
5526
|
+
* replay tombstones (a SAML assertion id, a JWT `jti`) where the first caller
|
|
5527
|
+
* wins. The database path is atomic via the primary key. Secondary-storage-only
|
|
5528
|
+
* verification is not supported for reservation and runtime implementations
|
|
5529
|
+
* should fail closed unless verification is backed by the database.
|
|
5530
|
+
*/
|
|
5531
|
+
reserveVerificationValue(data: {
|
|
5532
|
+
identifier: string;
|
|
5533
|
+
value: string;
|
|
5534
|
+
expiresAt: Date;
|
|
5535
|
+
}): Promise<boolean>;
|
|
5371
5536
|
updateVerificationByIdentifier(identifier: string, data: Partial<Verification>): Promise<Verification>;
|
|
5372
5537
|
refreshUserSessions(user: User): Promise<void>;
|
|
5373
5538
|
}
|
|
@@ -5919,8 +6084,30 @@ type DynamicBaseURLConfig = {
|
|
|
5919
6084
|
*/
|
|
5920
6085
|
type BaseURLConfig = string | DynamicBaseURLConfig;
|
|
5921
6086
|
interface BetterAuthRateLimitStorage {
|
|
5922
|
-
|
|
5923
|
-
|
|
6087
|
+
/**
|
|
6088
|
+
* Atomically records one request against `key` within the rolling `window`
|
|
6089
|
+
* (in seconds) and reports whether it is allowed.
|
|
6090
|
+
*
|
|
6091
|
+
* When `allowed` is true the count was incremented within the active window,
|
|
6092
|
+
* or the window had elapsed and was reset to start at 1. When `allowed` is
|
|
6093
|
+
* false the limit was already reached and `retryAfter` is the number of
|
|
6094
|
+
* seconds until the window frees up.
|
|
6095
|
+
*
|
|
6096
|
+
* Performing the check and the increment in a single step closes the
|
|
6097
|
+
* concurrent-bypass gap of the separate `get`/`set` path: N simultaneous
|
|
6098
|
+
* requests can no longer all pass a stale read before any increment lands.
|
|
6099
|
+
*
|
|
6100
|
+
* Custom storages must implement this operation directly. Better Auth no
|
|
6101
|
+
* longer accepts separate `get`/`set` rate-limit storage because that shape
|
|
6102
|
+
* cannot enforce a distributed limit under concurrent requests.
|
|
6103
|
+
*/
|
|
6104
|
+
consume: (key: string, rule: {
|
|
6105
|
+
window: number;
|
|
6106
|
+
max: number;
|
|
6107
|
+
}) => Promise<{
|
|
6108
|
+
allowed: boolean;
|
|
6109
|
+
retryAfter: number | null;
|
|
6110
|
+
}>;
|
|
5924
6111
|
}
|
|
5925
6112
|
type BetterAuthRateLimitRule = {
|
|
5926
6113
|
/**
|
|
@@ -6702,6 +6889,20 @@ type BetterAuthOptions = {
|
|
|
6702
6889
|
* @default "compact"
|
|
6703
6890
|
*/
|
|
6704
6891
|
strategy?: "compact" | "jwt" | "jwe";
|
|
6892
|
+
/**
|
|
6893
|
+
* JWT-specific configuration for `strategy: "jwt"`.
|
|
6894
|
+
*/
|
|
6895
|
+
jwt?: {
|
|
6896
|
+
/**
|
|
6897
|
+
* Which signing key is used for cookie-cache JWTs.
|
|
6898
|
+
*
|
|
6899
|
+
* - `"secret"`: uses the Better Auth secret with HS256.
|
|
6900
|
+
* - `"jwt-plugin"`: uses the installed `jwt()` plugin's asymmetric signing keys.
|
|
6901
|
+
*
|
|
6902
|
+
* @default "secret"
|
|
6903
|
+
*/
|
|
6904
|
+
signingKey?: "secret" | "jwt-plugin";
|
|
6905
|
+
};
|
|
6705
6906
|
/**
|
|
6706
6907
|
* Controls stateless cookie cache refresh behavior.
|
|
6707
6908
|
*
|
|
@@ -6881,9 +7082,13 @@ type BetterAuthOptions = {
|
|
|
6881
7082
|
*/
|
|
6882
7083
|
storeStateStrategy?: "database" | "cookie";
|
|
6883
7084
|
/**
|
|
6884
|
-
* Store account data after
|
|
7085
|
+
* Store provider account data after an OAuth flow in an encrypted
|
|
7086
|
+
* cookie. This includes OAuth token material such as access tokens,
|
|
7087
|
+
* refresh tokens, ID tokens, scopes, and token expiry.
|
|
6885
7088
|
*
|
|
6886
|
-
* This is useful for database-less
|
|
7089
|
+
* This is useful for database-less flows, but large provider tokens can
|
|
7090
|
+
* still hit browser or proxy cookie/header limits even though Better Auth
|
|
7091
|
+
* chunks oversized account cookies.
|
|
6887
7092
|
*
|
|
6888
7093
|
* @default false
|
|
6889
7094
|
*
|
|
@@ -7388,16 +7593,21 @@ interface SecondaryStorage {
|
|
|
7388
7593
|
get: (key: string) => Awaitable<unknown>;
|
|
7389
7594
|
/**
|
|
7390
7595
|
* Atomically get a value and delete it from storage.
|
|
7596
|
+
*/
|
|
7597
|
+
getAndDelete: (key: string) => Awaitable<unknown>;
|
|
7598
|
+
/**
|
|
7599
|
+
* Atomically increment the counter at `key` by one, returning the
|
|
7600
|
+
* post-increment value.
|
|
7391
7601
|
*
|
|
7392
|
-
*
|
|
7393
|
-
*
|
|
7394
|
-
*
|
|
7602
|
+
* When the key is absent, it is created with a value of `1` and the given
|
|
7603
|
+
* `ttl` (in SECONDS). The TTL is applied only on creation; later increments
|
|
7604
|
+
* never extend it, so the counter expires a fixed window after it was first
|
|
7605
|
+
* created.
|
|
7395
7606
|
*
|
|
7396
|
-
*
|
|
7397
|
-
*
|
|
7398
|
-
* security-sensitive consume paths.
|
|
7607
|
+
* Required so secondary-storage-backed rate limiting can enforce the limit
|
|
7608
|
+
* in one distributed-safe operation.
|
|
7399
7609
|
*/
|
|
7400
|
-
|
|
7610
|
+
increment: (key: string, ttl: number) => Awaitable<number>;
|
|
7401
7611
|
set: (
|
|
7402
7612
|
/**
|
|
7403
7613
|
* Key to store
|
package/dist/proxy.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-DQW8cveo.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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/electron",
|
|
3
|
-
"version": "1.7.0-beta.
|
|
3
|
+
"version": "1.7.0-beta.7",
|
|
4
4
|
"description": "Better Auth integration for Electron applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -80,17 +80,17 @@
|
|
|
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.
|
|
84
|
-
"better-auth": "1.7.0-beta.
|
|
83
|
+
"@better-auth/core": "1.7.0-beta.7",
|
|
84
|
+
"better-auth": "1.7.0-beta.7"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@better-auth/utils": "0.4.
|
|
88
|
-
"@better-fetch/fetch": "1.
|
|
87
|
+
"@better-auth/utils": "0.4.2",
|
|
88
|
+
"@better-fetch/fetch": "1.3.1",
|
|
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.
|
|
93
|
-
"better-auth": "^1.7.0-beta.
|
|
92
|
+
"@better-auth/core": "^1.7.0-beta.7",
|
|
93
|
+
"better-auth": "^1.7.0-beta.7"
|
|
94
94
|
},
|
|
95
95
|
"peerDependenciesMeta": {
|
|
96
96
|
"electron": {
|