yggdrasil 1.6.1 → 1.7.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/HISTORY.md +4 -0
- package/README.md +6 -0
- package/package.json +3 -3
- package/src/Client.js +11 -1
- package/src/utils.js +1 -1
package/HISTORY.md
CHANGED
package/README.md
CHANGED
|
@@ -46,6 +46,12 @@ ygg.validate(token).then(
|
|
|
46
46
|
(error)=>{}
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
+
//Invalidate all accessTokens using a current valid accessToken and clientToken.
|
|
50
|
+
ygg.invalidate(accessToken, clientToken).then(
|
|
51
|
+
(response)=>{},
|
|
52
|
+
(error)=>{}
|
|
53
|
+
);
|
|
54
|
+
|
|
49
55
|
//Invalidate all accessTokens
|
|
50
56
|
ygg.signout(username, password).then(
|
|
51
57
|
(response)=>{},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yggdrasil",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"author": "Zeke Sonxx <zeke@zekesonxx.com>",
|
|
5
5
|
"description": "Mojang authentication (Yggdrasil) client",
|
|
6
6
|
"scripts": {
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/node": "^
|
|
32
|
-
"@types/node-fetch": "^
|
|
31
|
+
"@types/node": "^17.0.4",
|
|
32
|
+
"@types/node-fetch": "^3.0.3",
|
|
33
33
|
"@types/uuid": "^8.3.0",
|
|
34
34
|
"mocha": "^9.0.0",
|
|
35
35
|
"nock": "^13.0.2",
|
package/src/Client.js
CHANGED
|
@@ -63,11 +63,21 @@ function loader (moduleOptions) {
|
|
|
63
63
|
async function signout (username, password) {
|
|
64
64
|
return await utils.call(moduleOptions?.host ?? defaultHost, 'signout', { username, password }, moduleOptions?.agent)
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Invalidates all access tokens using client/access token pair.
|
|
69
|
+
* @param {String} clientToken Client Token
|
|
70
|
+
* @param {String} accessToken Access Token
|
|
71
|
+
*/
|
|
72
|
+
async function invalidate (accessToken, clientToken) {
|
|
73
|
+
return await utils.call(moduleOptions?.host ?? defaultHost, 'invalidate', { accessToken, clientToken }, moduleOptions?.agent)
|
|
74
|
+
}
|
|
66
75
|
return {
|
|
67
76
|
auth: utils.callbackify(auth, 1),
|
|
68
77
|
refresh: utils.callbackify(refresh, 3),
|
|
69
78
|
signout: utils.callbackify(signout, 1),
|
|
70
|
-
validate: utils.callbackify(validate, 2)
|
|
79
|
+
validate: utils.callbackify(validate, 2),
|
|
80
|
+
invalidate: utils.callbackify(invalidate, 2)
|
|
71
81
|
}
|
|
72
82
|
}
|
|
73
83
|
|
package/src/utils.js
CHANGED