Socket
Socket
Sign inDemoInstall

noblox.js

Package Overview
Dependencies
6
Maintainers
2
Versions
55
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.5.6 to 4.6.0

lib/user/setCookie.js

7

examples/cleanup.js
// Exile specific members in a group, including by rank and by name. Useful for cleaning up bots.
var rbx = require('roblox-js')
var rbx = require('noblox.js')
var ProgressBar = require('progress')
var username = ''
var password = ''
var cookie = ''
var group = 0

@@ -10,3 +9,3 @@ var rank = null // Make this the rank number if you want to use rank.

rbx.login(username, password)
rbx.setCookie(cookie)
.then(function () {

@@ -13,0 +12,0 @@ // This allows you to retrieve only a specific set of pages.

// Delete posts from a group wall, including by post content and by author name.
var rbx = require('roblox-js')
var rbx = require('noblox.js')
var ProgressBar = require('progress')
var username = ''
var password = ''
var cookie = ''
var group = 0
rbx.login(username, password)
rbx.setCookie(cookie)
.then(function () {

@@ -10,0 +9,0 @@ // This allows you to retrieve only a specific set of pages.

// Revert player ranks to their original rank in a certain range.
var rbx = require('roblox-js')
var rbx = require('noblox.js')
var ProgressBar = require('progress')
var username = ''
var password = ''
var cookie = ''
var group = 0

@@ -14,3 +13,3 @@

rbx.login(username, password)
rbx.setCookie(cookie)
.then(function () {

@@ -17,0 +16,0 @@ var pages = []

// Save all the players in a group to a file with status updates.
var rbx = require('roblox-js')
var rbx = require('noblox.js')
var ProgressBar = require('progress')

@@ -4,0 +4,0 @@ var js = require('JSONStream')

@@ -1,2 +0,2 @@

var rbx = require('roblox-js')
var rbx = require('noblox.js')
var ProgressBar = require('progress')

@@ -6,6 +6,5 @@ var js = require('JSONStream')

var group = 0
var username = ''
var password = ''
var cookie = ''
rbx.login(username, password)
rbx.setCookie(cookie)
.then(function () {

@@ -12,0 +11,0 @@ console.time('Time: ')

@@ -21,3 +21,5 @@ // Includes

var dataArray = body.data
if (!dataArray) return reject(new Error('Error while retreiving players!'))
if (nextPageCursor === null) {

@@ -29,2 +31,3 @@ if (dataArray.length > 0) {

}
currentPlayers = currentPlayers.concat(dataArray)

@@ -31,0 +34,0 @@ getPlayerData(groupId, roleId, nextPageCursor, currentPlayers).then(function (newCurrentPlayers) {

@@ -11,2 +11,3 @@ // Allows user to login with a cookie.json, bypassing the username/password captcha issues.

// Run relog
console.warn('Noblox - The use of cookieLogin is deprecated: Please make use of the new methods setCookie & refreshCookie.')
return relog(args.cookie)

@@ -13,0 +14,0 @@ .then(function (r) {

{
"name": "noblox.js",
"version": "4.5.6",
"version": "4.6.0",
"description": "A Node.js wrapper for ROBLOX. (original from sentanos)",

@@ -8,3 +8,4 @@ "main": "lib/index.js",

"scripts": {
"test": "eslint lib/"
"test": "eslint lib/",
"postinstall": "node postinstall.js"
},

@@ -39,2 +40,3 @@ "repository": {

"JSONStream": "^1.3.1",
"chalk": "^4.0.0",
"eslint": "^6.8.0",

@@ -46,2 +48,3 @@ "eslint-config-standard": "^14.1.0",

"eslint-plugin-standard": "^4.0.1",
"figlet": "^1.3.0",
"progress": "^2.0.0",

@@ -48,0 +51,0 @@ "standard": "^14.3.1"

@@ -52,7 +52,14 @@ <h1 align="center">

## Making use of new login workaround
> Note, as of v4.6.0 The way you login to Noblox has changed significantly.
> The library is no longer responsible for refreshing your cookies
>
> This is because of many reasons including that creating a file caused many security & usability issues and made the library incompatible with some hosts.
### Initial setup
1. Remove any usages of the `login` or `cookieLogin` methods.
2. Run `setCookie` with your cookie. This will store your cookie internally and validate it, but will perform **no** cookie refresh automatically
3. While this works, Roblox `.ROBLOSECURITY` cookies expire after an unknown length of time. For applications which run continuously, **you must** use the function `refreshCookie` to prevent this. This will refresh either the cookie you pass or the internally stored cookie and return the new one.
4. You need to store this new cookie somewhere - whether it be in a database or a JSON file file.
### Initial setup
1. Remove any usages of the `login` method.
2. Run `cookieLogin` when your app starts. You only need to run it on app start. Supply it with a cookie, guide on obtaining that below.
3. This cookie will be automatically refreshed. You never need to supply it again, but supplying it is unlikely to cause problems
> Note: By default, setCookie will validate the cookie you provide by making a HTTP request.
> To Disable this behaviour, pass `false` as the second parameter (validate)

@@ -64,3 +71,3 @@ ### Getting your cookie (Chrome):

4. Find `.ROBLOSECURITY`. Copy it's contents, which will start with `_|WARNING:-DO`
5. Put this full token, *including* the warning into cookieLogin: `rbx.cookieLogin( tokenHere )`
5. Put this full token, *including* the warning into cookieLogin: `rbx.setCookie( tokenHere )`

@@ -72,3 +79,3 @@ ### Example

async function startApp () {
await rbx.cookieLogin("_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_F9F1EA531adk")
await rbx.setCookie("_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_F9F1EA531adk")
// Do everything else, calling functions and the like.

@@ -80,7 +87,5 @@ let currentUser = await rbx.getCurrentUser()

## Drawbacks
- Only one application can be logged in at once.
- You need to set up something to store and refresh cookies yourself
- If the application is offline for like a week to a month you may need to get the cookie again
- Your cookie is stored within a file in the lib
- Roblox-js-server is **not** currently compatible. Use [noblox.js-server](https://github.com/Hamzah-z/noblox.js-server) instead.
- The application will **not** work on Heroku. This is because we store the cookie internally in a file, and files do not persist in Heroku.

@@ -87,0 +92,0 @@

@@ -1109,3 +1109,3 @@ // Type definitions for noblox.js@4.5.2

*/
function getFriendRequests(sortOrder?: SortOrder, limit?: Limit, cursor?: string, jar?: CookieJar): Promise<FriendRequestPage>;
function getFriendRequests(sortOrder?: SortOrder, limit?: Limit, cursor?: string, jar?: CookieJar): Promise<FriendRequestsPage>;

@@ -1180,3 +1180,3 @@ /**

*/
function getAction(row: string): AuditItemAction;
function getAction(row: string): AuditItem;

@@ -1344,5 +1344,5 @@ /**

on(event: 'error', listener: (err: Error) => void): this;
on(event: 'data', listener: (joinRequest: GroupHandleJoinRequest) => void): this;
on(event: 'data', listener: (joinRequest: GroupJoinRequest) => void): this;
emit(event: 'handle', joinRequest: GroupHandleJoinRequest, accept: boolean, callback?: () => void): boolean;
emit(event: 'handle', joinRequest: GroupJoinRequest, accept: boolean, callback?: () => void): boolean;
}

@@ -1495,2 +1495,2 @@

function onNotification(jar?: CookieJar): OnNotificationEventEmitter;
}
}
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