Socket
Socket
Sign inDemoInstall

noblox.js

Package Overview
Dependencies
8
Maintainers
2
Versions
55
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.7.1 to 4.7.2

52

lib/util/refreshCookie.js
// Includes
const options = require('../options.js')
const getGeneralToken = require('./getGeneralToken.js').func
const getVerification = require('./getVerification.js').func
const http = require('./http.js').func

@@ -16,34 +15,27 @@ // Args

}
return getVerification({ url: 'https://www.roblox.com/my/account#!/security' })
.then((ver) => {
if (!ver.header) throw new Error('Failed to refresh - Invalid or expired cookie.')
return getGeneralToken({}).then((token) => {
return http({
url: 'https://www.roblox.com/authentication/signoutfromallsessionsandreauthenticate',
options: {
method: 'POST',
resolveWithFullResponse: true,
verification: ver.header,
jar: null,
headers: {
'X-CSRF-TOKEN': token
},
form: {
__RequestVerificationToken: ver.inputs.__RequestVerificationToken
}
}
}).then((res) => {
const cookies = res.headers['set-cookie']
if (cookies) {
const cookie = cookies.toString().match(/\.ROBLOSECURITY=(.*?);/)[1]
options.jar.session = cookie
return cookie
} else {
throw new Error('Failed to refresh cookie: None returned.')
}
})
})
return getGeneralToken({}).then((token) => {
return http({
url: 'https://www.roblox.com/authentication/signoutfromallsessionsandreauthenticate',
options: {
method: 'POST',
resolveWithFullResponse: true,
jar: null,
headers: {
'X-CSRF-TOKEN': token
}
}
}).then((res) => {
const cookies = res.headers['set-cookie']
if (cookies) {
const cookie = cookies.toString().match(/\.ROBLOSECURITY=(.*?);/)[1]
options.jar.session = cookie
return cookie
} else {
throw new Error('Failed to refresh cookie: None returned.')
}
})
})
}
module.exports = refreshCookie
{
"name": "noblox.js",
"version": "4.7.1",
"version": "4.7.2",
"description": "A Node.js wrapper for ROBLOX. (original from sentanos)",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc