@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.
@@ -94,117 +94,117 @@
94
94
  },
95
95
  {
96
96
  "description": "Discord OAuth client id",
97
- "docsUrl": "https://github.com/absolutejs/auth#providers",
97
+ "docsUrl": "https://discord.com/developers/applications",
98
98
  "key": "DISCORD_CLIENT_ID",
99
99
  "when": "providersConfiguration.discord"
100
100
  },
101
101
  {
102
102
  "description": "Discord OAuth client secret",
103
- "docsUrl": "https://github.com/absolutejs/auth#providers",
103
+ "docsUrl": "https://discord.com/developers/applications",
104
104
  "key": "DISCORD_CLIENT_SECRET",
105
105
  "secret": true,
106
106
  "when": "providersConfiguration.discord"
107
107
  },
108
108
  {
109
109
  "description": "Facebook OAuth client id",
110
- "docsUrl": "https://github.com/absolutejs/auth#providers",
110
+ "docsUrl": "https://developers.facebook.com/apps",
111
111
  "key": "FACEBOOK_CLIENT_ID",
112
112
  "when": "providersConfiguration.facebook"
113
113
  },
114
114
  {
115
115
  "description": "Facebook OAuth client secret",
116
- "docsUrl": "https://github.com/absolutejs/auth#providers",
116
+ "docsUrl": "https://developers.facebook.com/apps",
117
117
  "key": "FACEBOOK_CLIENT_SECRET",
118
118
  "secret": true,
119
119
  "when": "providersConfiguration.facebook"
120
120
  },
121
121
  {
122
122
  "description": "Github OAuth client id",
123
- "docsUrl": "https://github.com/absolutejs/auth#providers",
123
+ "docsUrl": "https://github.com/settings/developers",
124
124
  "key": "GITHUB_CLIENT_ID",
125
125
  "when": "providersConfiguration.github"
126
126
  },
127
127
  {
128
128
  "description": "Github OAuth client secret",
129
- "docsUrl": "https://github.com/absolutejs/auth#providers",
129
+ "docsUrl": "https://github.com/settings/developers",
130
130
  "key": "GITHUB_CLIENT_SECRET",
131
131
  "secret": true,
132
132
  "when": "providersConfiguration.github"
133
133
  },
134
134
  {
135
135
  "description": "Google OAuth client id",
136
- "docsUrl": "https://github.com/absolutejs/auth#providers",
136
+ "docsUrl": "https://console.cloud.google.com/apis/credentials",
137
137
  "key": "GOOGLE_CLIENT_ID",
138
138
  "when": "providersConfiguration.google"
139
139
  },
140
140
  {
141
141
  "description": "Google OAuth client secret",
142
- "docsUrl": "https://github.com/absolutejs/auth#providers",
142
+ "docsUrl": "https://console.cloud.google.com/apis/credentials",
143
143
  "key": "GOOGLE_CLIENT_SECRET",
144
144
  "secret": true,
145
145
  "when": "providersConfiguration.google"
146
146
  },
147
147
  {
148
148
  "description": "Linkedin OAuth client id",
149
- "docsUrl": "https://github.com/absolutejs/auth#providers",
149
+ "docsUrl": "https://www.linkedin.com/developers/apps",
150
150
  "key": "LINKEDIN_CLIENT_ID",
151
151
  "when": "providersConfiguration.linkedin"
152
152
  },
153
153
  {
154
154
  "description": "Linkedin OAuth client secret",
155
- "docsUrl": "https://github.com/absolutejs/auth#providers",
155
+ "docsUrl": "https://www.linkedin.com/developers/apps",
156
156
  "key": "LINKEDIN_CLIENT_SECRET",
157
157
  "secret": true,
158
158
  "when": "providersConfiguration.linkedin"
159
159
  },
160
160
  {
161
161
  "description": "Microsoft OAuth client id",
162
- "docsUrl": "https://github.com/absolutejs/auth#providers",
162
+ "docsUrl": "https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade",
163
163
  "key": "MICROSOFT_CLIENT_ID",
164
164
  "when": "providersConfiguration.microsoft"
165
165
  },
166
166
  {
167
167
  "description": "Microsoft OAuth client secret",
168
- "docsUrl": "https://github.com/absolutejs/auth#providers",
168
+ "docsUrl": "https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade",
169
169
  "key": "MICROSOFT_CLIENT_SECRET",
170
170
  "secret": true,
171
171
  "when": "providersConfiguration.microsoft"
172
172
  },
173
173
  {
174
174
  "description": "Slack OAuth client id",
175
- "docsUrl": "https://github.com/absolutejs/auth#providers",
175
+ "docsUrl": "https://api.slack.com/apps",
176
176
  "key": "SLACK_CLIENT_ID",
177
177
  "when": "providersConfiguration.slack"
178
178
  },
179
179
  {
180
180
  "description": "Slack OAuth client secret",
181
- "docsUrl": "https://github.com/absolutejs/auth#providers",
181
+ "docsUrl": "https://api.slack.com/apps",
182
182
  "key": "SLACK_CLIENT_SECRET",
183
183
  "secret": true,
184
184
  "when": "providersConfiguration.slack"
185
185
  },
186
186
  {
187
187
  "description": "Spotify OAuth client id",
188
- "docsUrl": "https://github.com/absolutejs/auth#providers",
188
+ "docsUrl": "https://developer.spotify.com/dashboard",
189
189
  "key": "SPOTIFY_CLIENT_ID",
190
190
  "when": "providersConfiguration.spotify"
191
191
  },
192
192
  {
193
193
  "description": "Spotify OAuth client secret",
194
- "docsUrl": "https://github.com/absolutejs/auth#providers",
194
+ "docsUrl": "https://developer.spotify.com/dashboard",
195
195
  "key": "SPOTIFY_CLIENT_SECRET",
196
196
  "secret": true,
197
197
  "when": "providersConfiguration.spotify"
198
198
  },
199
199
  {
200
200
  "description": "Twitch OAuth client id",
201
- "docsUrl": "https://github.com/absolutejs/auth#providers",
201
+ "docsUrl": "https://dev.twitch.tv/console/apps",
202
202
  "key": "TWITCH_CLIENT_ID",
203
203
  "when": "providersConfiguration.twitch"
204
204
  },
205
205
  {
206
206
  "description": "Twitch OAuth client secret",
207
- "docsUrl": "https://github.com/absolutejs/auth#providers",
207
+ "docsUrl": "https://dev.twitch.tv/console/apps",
208
208
  "key": "TWITCH_CLIENT_SECRET",
209
209
  "secret": true,
210
210
  "when": "providersConfiguration.twitch"
@@ -930,7 +930,7 @@ export declare const buildClientProviders: (providersConfiguration: OAuth2Config
930
930
  authIn: "header";
931
931
  encoding: "application/json";
932
932
  method: "GET";
933
- url: (config: any) => string;
933
+ url: string;
934
934
  };
935
935
  scopeRequired: false;
936
936
  subject: string[];
@@ -1077,7 +1077,7 @@ var providers = defineProviders({
1077
1077
  }
1078
1078
  },
1079
1079
  microsoftentraid: {
1080
- authorizationUrl: (config) => `https://${config.tenantId}.b2clogin.com/${config.tenantId}/oauth2/v2.0/authorize`,
1080
+ authorizationUrl: (config) => `https://login.microsoftonline.com/${config.tenantId}/oauth2/v2.0/authorize`,
1081
1081
  isOIDC: true,
1082
1082
  isRefreshable: true,
1083
1083
  PKCEMethod: "S256",
@@ -1085,15 +1085,15 @@ var providers = defineProviders({
1085
1085
  authIn: "header",
1086
1086
  encoding: "application/json",
1087
1087
  method: "GET",
1088
- url: (config) => `https://${config.tenantId}.b2clogin.com/${config.tenantId}/openid/userinfo`
1088
+ url: "https://graph.microsoft.com/oidc/userinfo"
1089
1089
  },
1090
1090
  scopeRequired: false,
1091
- subject: ["id"],
1091
+ subject: ["sub"],
1092
1092
  subjectType: "string",
1093
1093
  tokenRequest: {
1094
1094
  authIn: "body",
1095
1095
  encoding: "application/x-www-form-urlencoded",
1096
- url: (config) => `https://${config.tenantId}.b2clogin.com/${config.tenantId}/oauth2/v2.0/token`
1096
+ url: (config) => `https://login.microsoftonline.com/${config.tenantId}/oauth2/v2.0/token`
1097
1097
  }
1098
1098
  },
1099
1099
  monday: {
@@ -1214,7 +1214,7 @@ var providers = defineProviders({
1214
1214
  }
1215
1215
  },
1216
1216
  onspark: {
1217
- authorizationUrl: "https://app.onspark.com/oauth2/authorize",
1217
+ authorizationUrl: "https://onspark.com/oauth2/authorize",
1218
1218
  email: ["email"],
1219
1219
  familyName: ["family_name"],
1220
1220
  fullName: ["name"],
@@ -1227,13 +1227,13 @@ var providers = defineProviders({
1227
1227
  authIn: "header",
1228
1228
  encoding: "application/json",
1229
1229
  method: "GET",
1230
- url: "https://app.onspark.com/oauth2/userinfo"
1230
+ url: "https://onspark.com/oauth2/userinfo"
1231
1231
  },
1232
1232
  revocationRequest: {
1233
1233
  authIn: "body",
1234
1234
  encoding: "application/x-www-form-urlencoded",
1235
1235
  tokenParamName: "token",
1236
- url: "https://app.onspark.com/oauth2/revoke"
1236
+ url: "https://onspark.com/oauth2/revoke"
1237
1237
  },
1238
1238
  scopeRequired: true,
1239
1239
  subject: ["sub"],
@@ -1241,7 +1241,7 @@ var providers = defineProviders({
1241
1241
  tokenRequest: {
1242
1242
  authIn: "body",
1243
1243
  encoding: "application/x-www-form-urlencoded",
1244
- url: "https://app.onspark.com/oauth2/token"
1244
+ url: "https://onspark.com/oauth2/token"
1245
1245
  }
1246
1246
  },
1247
1247
  osu: {
@@ -2109,10 +2109,7 @@ var getWithingsProps = async (config) => {
2109
2109
  nonceUrl.searchParams.set("timestamp", timestamp.toString());
2110
2110
  nonceUrl.searchParams.set("signature", hashedSignature);
2111
2111
  const nonceTarget = nonceUrl.toString();
2112
- const nonceResponse = await fetch(nonceTarget, {
2113
- ...h2IfHttps(nonceTarget),
2114
- method: "POST"
2115
- });
2112
+ const nonceResponse = await fetch(nonceTarget, { method: "POST" });
2116
2113
  const nonceData = await nonceResponse.json();
2117
2114
  if (nonceData.status === 0) {
2118
2115
  return {
@@ -2122,10 +2119,6 @@ var getWithingsProps = async (config) => {
2122
2119
  }
2123
2120
  return;
2124
2121
  };
2125
- var h2IfHttps = (url) => {
2126
- const init = url.startsWith("https://") ? { protocol: "http2" } : {};
2127
- return init;
2128
- };
2129
2122
  var hmacSha256 = async (message, secret) => {
2130
2123
  const encoder = new TextEncoder;
2131
2124
  const key = await crypto.subtle.importKey("raw", encoder.encode(secret), { hash: "SHA-256", name: "HMAC" }, false, ["sign"]);
@@ -2496,10 +2489,7 @@ var buildOAuth2Client = async (meta, config) => {
2496
2489
  init.body = encoding === "application/json" ? JSON.stringify(resolvedBody) : new URLSearchParams(resolvedBody).toString();
2497
2490
  }
2498
2491
  const profileTarget = endpoint.toString();
2499
- const response = await fetch(profileTarget, {
2500
- ...h2IfHttps(profileTarget),
2501
- ...init
2502
- });
2492
+ const response = await fetch(profileTarget, init);
2503
2493
  if (!response.ok)
2504
2494
  throw await createOAuth2FetchError(response);
2505
2495
  return response.json();
@@ -2524,9 +2514,7 @@ var buildOAuth2Client = async (meta, config) => {
2524
2514
  encoding,
2525
2515
  url: tokenUrl
2526
2516
  });
2527
- const response = await fetch(request, {
2528
- ...h2IfHttps(request.url)
2529
- });
2517
+ const response = await fetch(request);
2530
2518
  if (!response.ok)
2531
2519
  throw await createOAuth2FetchError(response);
2532
2520
  return response.json();
@@ -2580,9 +2568,7 @@ var buildOAuth2Client = async (meta, config) => {
2580
2568
  url: `${endpoint.toString()}?${tokenParamName}=${token}`
2581
2569
  });
2582
2570
  }
2583
- const response = await fetch(request, {
2584
- ...h2IfHttps(request.url)
2585
- });
2571
+ const response = await fetch(request);
2586
2572
  if (!response.ok)
2587
2573
  throw await createOAuth2FetchError(response);
2588
2574
  },
@@ -2614,9 +2600,7 @@ var buildOAuth2Client = async (meta, config) => {
2614
2600
  encoding,
2615
2601
  url: tokenUrl
2616
2602
  });
2617
- const response = await fetch(request, {
2618
- ...h2IfHttps(request.url)
2619
- });
2603
+ const response = await fetch(request);
2620
2604
  if (!response.ok)
2621
2605
  throw await createOAuth2FetchError(response);
2622
2606
  const tokenResponse = await response.json();
@@ -2649,5 +2633,5 @@ export {
2649
2633
  decodeJWT
2650
2634
  };
2651
2635
 
2652
- //# debugId=2016F2B1E2EEE32864756E2164756E21
2636
+ //# debugId=D1656E8C9FE7498064756E2164756E21
2653
2637
  //# sourceMappingURL=index.js.map