@absolutejs/auth 0.53.1 → 0.53.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/index.js CHANGED
@@ -1212,7 +1212,7 @@ var providers = defineProviders({
1212
1212
  }
1213
1213
  },
1214
1214
  microsoftentraid: {
1215
- authorizationUrl: (config) => `https://${config.tenantId}.b2clogin.com/${config.tenantId}/oauth2/v2.0/authorize`,
1215
+ authorizationUrl: (config) => `https://login.microsoftonline.com/${config.tenantId}/oauth2/v2.0/authorize`,
1216
1216
  isOIDC: true,
1217
1217
  isRefreshable: true,
1218
1218
  PKCEMethod: "S256",
@@ -1220,15 +1220,15 @@ var providers = defineProviders({
1220
1220
  authIn: "header",
1221
1221
  encoding: "application/json",
1222
1222
  method: "GET",
1223
- url: (config) => `https://${config.tenantId}.b2clogin.com/${config.tenantId}/openid/userinfo`
1223
+ url: "https://graph.microsoft.com/oidc/userinfo"
1224
1224
  },
1225
1225
  scopeRequired: false,
1226
- subject: ["id"],
1226
+ subject: ["sub"],
1227
1227
  subjectType: "string",
1228
1228
  tokenRequest: {
1229
1229
  authIn: "body",
1230
1230
  encoding: "application/x-www-form-urlencoded",
1231
- url: (config) => `https://${config.tenantId}.b2clogin.com/${config.tenantId}/oauth2/v2.0/token`
1231
+ url: (config) => `https://login.microsoftonline.com/${config.tenantId}/oauth2/v2.0/token`
1232
1232
  }
1233
1233
  },
1234
1234
  monday: {
@@ -1349,7 +1349,7 @@ var providers = defineProviders({
1349
1349
  }
1350
1350
  },
1351
1351
  onspark: {
1352
- authorizationUrl: "https://app.onspark.com/oauth2/authorize",
1352
+ authorizationUrl: "https://onspark.com/oauth2/authorize",
1353
1353
  email: ["email"],
1354
1354
  familyName: ["family_name"],
1355
1355
  fullName: ["name"],
@@ -1362,13 +1362,13 @@ var providers = defineProviders({
1362
1362
  authIn: "header",
1363
1363
  encoding: "application/json",
1364
1364
  method: "GET",
1365
- url: "https://app.onspark.com/oauth2/userinfo"
1365
+ url: "https://onspark.com/oauth2/userinfo"
1366
1366
  },
1367
1367
  revocationRequest: {
1368
1368
  authIn: "body",
1369
1369
  encoding: "application/x-www-form-urlencoded",
1370
1370
  tokenParamName: "token",
1371
- url: "https://app.onspark.com/oauth2/revoke"
1371
+ url: "https://onspark.com/oauth2/revoke"
1372
1372
  },
1373
1373
  scopeRequired: true,
1374
1374
  subject: ["sub"],
@@ -1376,7 +1376,7 @@ var providers = defineProviders({
1376
1376
  tokenRequest: {
1377
1377
  authIn: "body",
1378
1378
  encoding: "application/x-www-form-urlencoded",
1379
- url: "https://app.onspark.com/oauth2/token"
1379
+ url: "https://onspark.com/oauth2/token"
1380
1380
  }
1381
1381
  },
1382
1382
  osu: {
@@ -2244,10 +2244,7 @@ var getWithingsProps = async (config) => {
2244
2244
  nonceUrl.searchParams.set("timestamp", timestamp.toString());
2245
2245
  nonceUrl.searchParams.set("signature", hashedSignature);
2246
2246
  const nonceTarget = nonceUrl.toString();
2247
- const nonceResponse = await fetch(nonceTarget, {
2248
- ...h2IfHttps(nonceTarget),
2249
- method: "POST"
2250
- });
2247
+ const nonceResponse = await fetch(nonceTarget, { method: "POST" });
2251
2248
  const nonceData = await nonceResponse.json();
2252
2249
  if (nonceData.status === 0) {
2253
2250
  return {
@@ -2257,10 +2254,6 @@ var getWithingsProps = async (config) => {
2257
2254
  }
2258
2255
  return;
2259
2256
  };
2260
- var h2IfHttps = (url) => {
2261
- const init = url.startsWith("https://") ? { protocol: "http2" } : {};
2262
- return init;
2263
- };
2264
2257
  var hmacSha256 = async (message, secret) => {
2265
2258
  const encoder = new TextEncoder;
2266
2259
  const key = await crypto.subtle.importKey("raw", encoder.encode(secret), { hash: "SHA-256", name: "HMAC" }, false, ["sign"]);
@@ -2631,10 +2624,7 @@ var buildOAuth2Client = async (meta, config) => {
2631
2624
  init.body = encoding === "application/json" ? JSON.stringify(resolvedBody) : new URLSearchParams(resolvedBody).toString();
2632
2625
  }
2633
2626
  const profileTarget = endpoint.toString();
2634
- const response = await fetch(profileTarget, {
2635
- ...h2IfHttps(profileTarget),
2636
- ...init
2637
- });
2627
+ const response = await fetch(profileTarget, init);
2638
2628
  if (!response.ok)
2639
2629
  throw await createOAuth2FetchError(response);
2640
2630
  return response.json();
@@ -2659,9 +2649,7 @@ var buildOAuth2Client = async (meta, config) => {
2659
2649
  encoding,
2660
2650
  url: tokenUrl
2661
2651
  });
2662
- const response = await fetch(request, {
2663
- ...h2IfHttps(request.url)
2664
- });
2652
+ const response = await fetch(request);
2665
2653
  if (!response.ok)
2666
2654
  throw await createOAuth2FetchError(response);
2667
2655
  return response.json();
@@ -2715,9 +2703,7 @@ var buildOAuth2Client = async (meta, config) => {
2715
2703
  url: `${endpoint.toString()}?${tokenParamName}=${token}`
2716
2704
  });
2717
2705
  }
2718
- const response = await fetch(request, {
2719
- ...h2IfHttps(request.url)
2720
- });
2706
+ const response = await fetch(request);
2721
2707
  if (!response.ok)
2722
2708
  throw await createOAuth2FetchError(response);
2723
2709
  },
@@ -2749,9 +2735,7 @@ var buildOAuth2Client = async (meta, config) => {
2749
2735
  encoding,
2750
2736
  url: tokenUrl
2751
2737
  });
2752
- const response = await fetch(request, {
2753
- ...h2IfHttps(request.url)
2754
- });
2738
+ const response = await fetch(request);
2755
2739
  if (!response.ok)
2756
2740
  throw await createOAuth2FetchError(response);
2757
2741
  const tokenResponse = await response.json();
@@ -28075,5 +28059,5 @@ export {
28075
28059
  AuthIdentityConflictError
28076
28060
  };
28077
28061
 
28078
- //# debugId=02EB747B81877D6664756E2164756E21
28062
+ //# debugId=D6385E0F9EA5534664756E2164756E21
28079
28063
  //# sourceMappingURL=index.js.map