oauth4webapi 2.4.2 → 2.4.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/README.md +1 -1
- package/build/index.js +2 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ import * as oauth2 from 'oauth4webapi'
|
|
|
43
43
|
**`example`** Deno import
|
|
44
44
|
|
|
45
45
|
```js
|
|
46
|
-
import * as oauth2 from 'https://deno.land/x/oauth4webapi@v2.4.
|
|
46
|
+
import * as oauth2 from 'https://deno.land/x/oauth4webapi@v2.4.3/mod.ts'
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
- Authorization Code Flow - OpenID Connect [source](examples/code.ts), or plain OAuth 2 [source](examples/oauth.ts)
|
package/build/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let USER_AGENT;
|
|
2
2
|
if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
|
|
3
3
|
const NAME = 'oauth4webapi';
|
|
4
|
-
const VERSION = 'v2.4.
|
|
4
|
+
const VERSION = 'v2.4.3';
|
|
5
5
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
6
6
|
}
|
|
7
7
|
export const clockSkew = Symbol();
|
|
@@ -265,24 +265,7 @@ function getKeyAndKid(input) {
|
|
|
265
265
|
return { key: input.key, kid: input.kid };
|
|
266
266
|
}
|
|
267
267
|
function formUrlEncode(token) {
|
|
268
|
-
return encodeURIComponent(token).replace(
|
|
269
|
-
switch (substring) {
|
|
270
|
-
case '-':
|
|
271
|
-
case '_':
|
|
272
|
-
case '.':
|
|
273
|
-
case '!':
|
|
274
|
-
case '~':
|
|
275
|
-
case '*':
|
|
276
|
-
case "'":
|
|
277
|
-
case '(':
|
|
278
|
-
case ')':
|
|
279
|
-
return `%${substring.charCodeAt(0).toString(16).toUpperCase()}`;
|
|
280
|
-
case '%20':
|
|
281
|
-
return '+';
|
|
282
|
-
default:
|
|
283
|
-
throw new Error();
|
|
284
|
-
}
|
|
285
|
-
});
|
|
268
|
+
return encodeURIComponent(token).replace(/%20/g, '+');
|
|
286
269
|
}
|
|
287
270
|
function clientSecretBasic(clientId, clientSecret) {
|
|
288
271
|
const username = formUrlEncode(clientId);
|