Skip to content

Commit

Permalink
v4.6.3: Fix getCurrentToken (Move to v2) (#164)
Browse files Browse the repository at this point in the history
* v4.6.3: Fix getCurrentToken (Move to v2)

* Remove CSRF from getGroups

* Confirm getGroups to standard (oops)
  • Loading branch information
Neztore authored Jul 17, 2020
1 parent da9f1ae commit 106f45d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
11 changes: 2 additions & 9 deletions lib/user/getGroups.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
// Includes
var http = require('../util/http.js').func
var getGeneralToken = require('../util/getGeneralToken.js').func

// Args
exports.required = ['userId']
exports.optional = ['jar']

// Define
function getGroups (jar, token, userId) {
function getGroups (jar, userId) {
return new Promise((resolve, reject) => {
var httpOpt = {
url: `//api.roblox.com/users/${userId}/groups`,
options: {
method: 'GET',
jar: jar,
headers: {
'X-CSRF-TOKEN': token
},
resolveWithFullResponse: true
}
}
Expand All @@ -39,8 +35,5 @@ function getGroups (jar, token, userId) {

exports.func = function (args, senderUserId) {
var jar = args.jar
return getGeneralToken({ jar: jar })
.then(function (xcsrf) {
return getGroups(jar, xcsrf, args.userId)
})
return getGroups(jar, args.userId)
}
2 changes: 1 addition & 1 deletion lib/util/getGeneralToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports.optional = ['jar']
function getGeneralToken (jar) {
var httpOpt = {
// This will never actually sign you out because an X-CSRF-TOKEN isn't provided, only received
url: '//auth.roblox.com/v1/logout', // REQUIRES https. Thanks for letting me know, ROBLOX...
url: '//auth.roblox.com/v2/logout', // REQUIRES https. Thanks for letting me know, ROBLOX...
options: {
resolveWithFullResponse: true,
method: 'POST',
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "noblox.js",
"version": "4.6.2",
"version": "4.6.3",
"description": "A Node.js wrapper for ROBLOX. (original from sentanos)",
"main": "lib/index.js",
"types": "typings/index.d.ts",
Expand Down

0 comments on commit 106f45d

Please sign in to comment.