@absolutejs/auth 0.48.1 → 0.48.3
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/cli/migrate.js +42 -15
- package/dist/cli/migrate.js.map +3 -3
- package/dist/htmx/index.js +50 -17
- package/dist/htmx/index.js.map +3 -3
- package/dist/index.js +50 -17
- package/dist/index.js.map +3 -3
- package/dist/providers/clients.d.ts +3 -3
- package/dist/providers/index.js +50 -17
- package/dist/providers/index.js.map +3 -3
- package/dist/routes/authorize.d.ts +2 -2
- package/dist/typebox.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -562,44 +562,44 @@ var providers = defineProviders({
|
|
|
562
562
|
url: "https://www.bungie.net/Platform/App/OAuth/token"
|
|
563
563
|
}
|
|
564
564
|
},
|
|
565
|
-
|
|
566
|
-
authorizationUrl: "https://
|
|
565
|
+
calendly: {
|
|
566
|
+
authorizationUrl: "https://auth.calendly.com/oauth/authorize",
|
|
567
|
+
email: ["resource", "email"],
|
|
568
|
+
fullName: ["resource", "name"],
|
|
567
569
|
isOIDC: false,
|
|
568
570
|
isRefreshable: true,
|
|
569
571
|
profileRequest: {
|
|
570
572
|
authIn: "header",
|
|
571
573
|
encoding: "application/json",
|
|
572
574
|
method: "GET",
|
|
573
|
-
url: "https://api.
|
|
575
|
+
url: "https://api.calendly.com/users/me"
|
|
574
576
|
},
|
|
575
|
-
scopeRequired:
|
|
576
|
-
subject: ["
|
|
577
|
+
scopeRequired: false,
|
|
578
|
+
subject: ["resource", "uri"],
|
|
577
579
|
subjectType: "string",
|
|
578
580
|
tokenRequest: {
|
|
579
581
|
authIn: "body",
|
|
580
582
|
encoding: "application/x-www-form-urlencoded",
|
|
581
|
-
url: "https://
|
|
583
|
+
url: "https://auth.calendly.com/oauth/token"
|
|
582
584
|
}
|
|
583
585
|
},
|
|
584
|
-
|
|
585
|
-
authorizationUrl: "https://
|
|
586
|
-
email: ["resource", "email"],
|
|
587
|
-
fullName: ["resource", "name"],
|
|
586
|
+
close: {
|
|
587
|
+
authorizationUrl: "https://app.close.com/oauth2/authorize/",
|
|
588
588
|
isOIDC: false,
|
|
589
589
|
isRefreshable: true,
|
|
590
590
|
profileRequest: {
|
|
591
591
|
authIn: "header",
|
|
592
592
|
encoding: "application/json",
|
|
593
593
|
method: "GET",
|
|
594
|
-
url: "https://api.
|
|
594
|
+
url: "https://api.close.com/api/v1/me/"
|
|
595
595
|
},
|
|
596
|
-
scopeRequired:
|
|
597
|
-
subject: ["
|
|
596
|
+
scopeRequired: true,
|
|
597
|
+
subject: ["id"],
|
|
598
598
|
subjectType: "string",
|
|
599
599
|
tokenRequest: {
|
|
600
600
|
authIn: "body",
|
|
601
601
|
encoding: "application/x-www-form-urlencoded",
|
|
602
|
-
url: "https://
|
|
602
|
+
url: "https://api.close.com/oauth2/token/"
|
|
603
603
|
}
|
|
604
604
|
},
|
|
605
605
|
coinbase: {
|
|
@@ -1582,6 +1582,33 @@ var providers = defineProviders({
|
|
|
1582
1582
|
url: "https://slack.com/api/openid.connect.token"
|
|
1583
1583
|
}
|
|
1584
1584
|
},
|
|
1585
|
+
slackuser: {
|
|
1586
|
+
accessTokenPath: ["authed_user", "access_token"],
|
|
1587
|
+
authorizationUrl: "https://slack.com/oauth/v2/authorize",
|
|
1588
|
+
isOIDC: false,
|
|
1589
|
+
isRefreshable: false,
|
|
1590
|
+
profileRequest: {
|
|
1591
|
+
authIn: "header",
|
|
1592
|
+
encoding: "application/json",
|
|
1593
|
+
method: "POST",
|
|
1594
|
+
url: "https://slack.com/api/auth.test"
|
|
1595
|
+
},
|
|
1596
|
+
revocationRequest: {
|
|
1597
|
+
authIn: "body",
|
|
1598
|
+
encoding: "application/json",
|
|
1599
|
+
tokenParamName: "token",
|
|
1600
|
+
url: "https://slack.com/api/auth.revoke"
|
|
1601
|
+
},
|
|
1602
|
+
scopeParamName: "user_scope",
|
|
1603
|
+
scopeRequired: true,
|
|
1604
|
+
subject: ["user_id"],
|
|
1605
|
+
subjectType: "string",
|
|
1606
|
+
tokenRequest: {
|
|
1607
|
+
authIn: "body",
|
|
1608
|
+
encoding: "application/x-www-form-urlencoded",
|
|
1609
|
+
url: "https://slack.com/api/oauth.v2.access"
|
|
1610
|
+
}
|
|
1611
|
+
},
|
|
1585
1612
|
spotify: {
|
|
1586
1613
|
authorizationUrl: "https://accounts.spotify.com/authorize",
|
|
1587
1614
|
isOIDC: false,
|
|
@@ -2495,6 +2522,7 @@ var providerOptions = Object.keys(providers).filter(isValidProviderOption);
|
|
|
2495
2522
|
var refreshableProviderOptions = Object.keys(providers).filter(isRefreshableProviderOption);
|
|
2496
2523
|
var revocableProviderOptions = Object.keys(providers).filter(isRevocableProviderOption);
|
|
2497
2524
|
var scopeRequiredProviderOptions = Object.keys(providers).filter(isScopeRequiredProviderOption);
|
|
2525
|
+
var readPath = (value, path) => path.reduce((cursor, key) => cursor && typeof cursor === "object" ? Reflect.get(cursor, key) : undefined, value);
|
|
2498
2526
|
var createOAuth2Client = async (providerName, config) => {
|
|
2499
2527
|
const meta = providers[providerName];
|
|
2500
2528
|
const isConfigPropertyFunction = (cfgProp) => typeof cfgProp === "function";
|
|
@@ -2516,7 +2544,7 @@ var createOAuth2Client = async (providerName, config) => {
|
|
|
2516
2544
|
url.searchParams.set("state", state);
|
|
2517
2545
|
if (scope.length !== 0) {
|
|
2518
2546
|
const delimeter = providerName === "withings" ? "," : " ";
|
|
2519
|
-
url.searchParams.set("scope", scope.join(delimeter));
|
|
2547
|
+
url.searchParams.set(meta.scopeParamName ?? "scope", scope.join(delimeter));
|
|
2520
2548
|
}
|
|
2521
2549
|
if (meta.PKCEMethod !== undefined) {
|
|
2522
2550
|
if (!codeVerifier) {
|
|
@@ -2687,7 +2715,12 @@ var createOAuth2Client = async (providerName, config) => {
|
|
|
2687
2715
|
});
|
|
2688
2716
|
if (!response.ok)
|
|
2689
2717
|
throw await createOAuth2FetchError(response);
|
|
2690
|
-
|
|
2718
|
+
const tokenResponse = await response.json();
|
|
2719
|
+
const nestedToken = meta.accessTokenPath ? readPath(tokenResponse, meta.accessTokenPath) : undefined;
|
|
2720
|
+
if (typeof nestedToken === "string" && nestedToken.length > 0 && tokenResponse && typeof tokenResponse === "object") {
|
|
2721
|
+
tokenResponse.access_token = nestedToken;
|
|
2722
|
+
}
|
|
2723
|
+
return tokenResponse;
|
|
2691
2724
|
}
|
|
2692
2725
|
};
|
|
2693
2726
|
};
|
|
@@ -27553,5 +27586,5 @@ export {
|
|
|
27553
27586
|
AuthIdentityConflictError
|
|
27554
27587
|
};
|
|
27555
27588
|
|
|
27556
|
-
//# debugId=
|
|
27589
|
+
//# debugId=DCFE29575482C4FF64756E2164756E21
|
|
27557
27590
|
//# sourceMappingURL=index.js.map
|