@digipair/skill-oauth2 0.55.1 → 0.56.0
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/index.cjs.js +14 -14
- package/index.esm.js +14 -14
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -7,38 +7,38 @@ var simpleOauth2 = require('simple-oauth2');
|
|
|
7
7
|
let OAuth2Service = class OAuth2Service {
|
|
8
8
|
async authorizationCodeUrl(params, _pinsSettingsList, _context) {
|
|
9
9
|
const { config } = params;
|
|
10
|
-
const
|
|
11
|
-
return
|
|
10
|
+
const client = new simpleOauth2.AuthorizationCode(config);
|
|
11
|
+
return client.authorizeURL(config);
|
|
12
12
|
}
|
|
13
13
|
async authorizationCodeAccessToken(params, _pinsSettingsList, _context) {
|
|
14
14
|
const { config, tokenParams } = params;
|
|
15
|
-
const
|
|
16
|
-
return
|
|
15
|
+
const client = new simpleOauth2.AuthorizationCode(config);
|
|
16
|
+
return client.getToken(tokenParams);
|
|
17
17
|
}
|
|
18
18
|
async authorizationCodeCreateToken(params, _pinsSettingsList, _context) {
|
|
19
19
|
const { config, accessToken } = params;
|
|
20
|
-
const
|
|
21
|
-
return
|
|
20
|
+
const client = new simpleOauth2.AuthorizationCode(config);
|
|
21
|
+
return client.createToken(accessToken);
|
|
22
22
|
}
|
|
23
23
|
async resourceOwnerPasswordAccessToken(params, _pinsSettingsList, _context) {
|
|
24
24
|
const { config, tokenParams } = params;
|
|
25
|
-
const
|
|
26
|
-
return
|
|
25
|
+
const client = new simpleOauth2.ResourceOwnerPassword(config);
|
|
26
|
+
return client.getToken(tokenParams);
|
|
27
27
|
}
|
|
28
28
|
async resourceOwnerPasswordCreateToken(params, _pinsSettingsList, _context) {
|
|
29
29
|
const { config, accessToken } = params;
|
|
30
|
-
const
|
|
31
|
-
return
|
|
30
|
+
const client = new simpleOauth2.ResourceOwnerPassword(config);
|
|
31
|
+
return client.createToken(accessToken);
|
|
32
32
|
}
|
|
33
33
|
async clientCredentialsAccessToken(params, _pinsSettingsList, _context) {
|
|
34
34
|
const { config, tokenParams } = params;
|
|
35
|
-
const
|
|
36
|
-
return
|
|
35
|
+
const client = new simpleOauth2.ClientCredentials(config);
|
|
36
|
+
return client.getToken(tokenParams);
|
|
37
37
|
}
|
|
38
38
|
async clientCredentialsCreateToken(params, _pinsSettingsList, _context) {
|
|
39
39
|
const { config, accessToken } = params;
|
|
40
|
-
const
|
|
41
|
-
return
|
|
40
|
+
const client = new simpleOauth2.ClientCredentials(config);
|
|
41
|
+
return client.createToken(accessToken);
|
|
42
42
|
}
|
|
43
43
|
async tokenExpired(params, _pinsSettingsList, _context) {
|
|
44
44
|
const { token } = params;
|
package/index.esm.js
CHANGED
|
@@ -3,38 +3,38 @@ import { AuthorizationCode, ResourceOwnerPassword, ClientCredentials } from 'sim
|
|
|
3
3
|
let OAuth2Service = class OAuth2Service {
|
|
4
4
|
async authorizationCodeUrl(params, _pinsSettingsList, _context) {
|
|
5
5
|
const { config } = params;
|
|
6
|
-
const
|
|
7
|
-
return
|
|
6
|
+
const client = new AuthorizationCode(config);
|
|
7
|
+
return client.authorizeURL(config);
|
|
8
8
|
}
|
|
9
9
|
async authorizationCodeAccessToken(params, _pinsSettingsList, _context) {
|
|
10
10
|
const { config, tokenParams } = params;
|
|
11
|
-
const
|
|
12
|
-
return
|
|
11
|
+
const client = new AuthorizationCode(config);
|
|
12
|
+
return client.getToken(tokenParams);
|
|
13
13
|
}
|
|
14
14
|
async authorizationCodeCreateToken(params, _pinsSettingsList, _context) {
|
|
15
15
|
const { config, accessToken } = params;
|
|
16
|
-
const
|
|
17
|
-
return
|
|
16
|
+
const client = new AuthorizationCode(config);
|
|
17
|
+
return client.createToken(accessToken);
|
|
18
18
|
}
|
|
19
19
|
async resourceOwnerPasswordAccessToken(params, _pinsSettingsList, _context) {
|
|
20
20
|
const { config, tokenParams } = params;
|
|
21
|
-
const
|
|
22
|
-
return
|
|
21
|
+
const client = new ResourceOwnerPassword(config);
|
|
22
|
+
return client.getToken(tokenParams);
|
|
23
23
|
}
|
|
24
24
|
async resourceOwnerPasswordCreateToken(params, _pinsSettingsList, _context) {
|
|
25
25
|
const { config, accessToken } = params;
|
|
26
|
-
const
|
|
27
|
-
return
|
|
26
|
+
const client = new ResourceOwnerPassword(config);
|
|
27
|
+
return client.createToken(accessToken);
|
|
28
28
|
}
|
|
29
29
|
async clientCredentialsAccessToken(params, _pinsSettingsList, _context) {
|
|
30
30
|
const { config, tokenParams } = params;
|
|
31
|
-
const
|
|
32
|
-
return
|
|
31
|
+
const client = new ClientCredentials(config);
|
|
32
|
+
return client.getToken(tokenParams);
|
|
33
33
|
}
|
|
34
34
|
async clientCredentialsCreateToken(params, _pinsSettingsList, _context) {
|
|
35
35
|
const { config, accessToken } = params;
|
|
36
|
-
const
|
|
37
|
-
return
|
|
36
|
+
const client = new ClientCredentials(config);
|
|
37
|
+
return client.createToken(accessToken);
|
|
38
38
|
}
|
|
39
39
|
async tokenExpired(params, _pinsSettingsList, _context) {
|
|
40
40
|
const { token } = params;
|