noblox / noblox.js

A Node.js API wrapper for Roblox.
https://noblox.js.org
MIT License
246 stars 139 forks source link

[BUG] getGeneralToken returns cookie error after setCookie #237

Closed Skyknight47 closed 3 years ago

Skyknight47 commented 3 years ago

Hey y'all, Since .cookieLogin got removed I've had non-stop issues with Noblox' new .setCookie method of logging in. For some reason regardless of what I try, it keeps telling me the Cookie is invalid, and/or that no Roblox warning text has been provided (even though this is incorrect)

Steps to reproduce the behavior:

  1. Go on an incognito tab
  2. Go to Roblox.com and login with the account you want to be using
  3. press F12 or CTRL+SHIFT+I
  4. Head to applications and copy the .ROBLOSECURITY Value and paste it in your cookie defining section thingy
  5. start your bot and it'll provide either error; -Warning: No Roblox warning detected in provided cookie. Ensure you include the entire .ROBLOSECURITY warning. -Failed to validate cookie: Are you sure the cookie is valid? Ensure you include the full cookie, including warning text.

When actually using a noblox function such as promote, it gives this red error text; Unhandled rejection Error: Cannot get CSRF: You are not logged in. at getGeneralToken (C:\Users\Mike\Desktop\Coding\baBot\node_modules\noblox.js\lib\util\getGeneralToken.js:13:11) at C:\Users\Mike\Desktop\Coding\baBot\node_modules\noblox.js\lib\util\getGeneralToken.js:38:12 at Object.add (C:\Users\Mike\Desktop\Coding\baBot\node_modules\noblox.js\lib\cache\wrap.js:15:18) at module.exports (C:\Users\Mike\Desktop\Coding\baBot\node_modules\noblox.js\lib\cache\addIf.js:21:15) at C:\Users\Mike\Desktop\Coding\baBot\node_modules\noblox.js\lib\cache\wrap.js:12:7 at Promise._execute (C:\Users\Mike\Desktop\Coding\baBot\node_modules\bluebird\js\release\debuggability.js:384:9) at Promise._resolveFromExecutor (C:\Users\Mike\Desktop\Coding\baBot\node_modules\bluebird\js\release\promise.js:518:18) at new Promise (C:\Users\Mike\Desktop\Coding\baBot\node_modules\bluebird\js\release\promise.js:103:10) at module.exports (C:\Users\Mike\Desktop\Coding\baBot\node_modules\noblox.js\lib\internal\promise.js:6:10) at wrap (C:\Users\Mike\Desktop\Coding\baBot\node_modules\noblox.js\lib\cache\wrap.js:11:12) at Object.module.exports [as wrap] (C:\Users\Mike\Desktop\Coding\baBot\node_modules\noblox.js\lib\cache\wrap.js:25:10) at exports.func (C:\Users\Mike\Desktop\Coding\baBot\node_modules\noblox.js\lib\util\getGeneralToken.js:37:16) at exports.func (C:\Users\Mike\Desktop\Coding\baBot\node_modules\noblox.js\lib\group\shout.js:48:10) at Object.shout (C:\Users\Mike\Desktop\Coding\baBot\node_modules\noblox.js\lib\internal\wrap.js:73:14) at Object.exports.run (C:\Users\Mike\Desktop\Coding\baBot\commands\shout.js:109:25) at processTicksAndRejections (node:internal/process/task_queues:93:5)

Expected behaviour It's supposed to work perfectly fine, and actually execute the functions

I've asked multiple people and multiple times within the Roblox API discord. Even members with the so-called "Experienced" role are not sure why it's not working. It gets even odder because I've tried a dozen suggestions to fix it.

I've tried:

My cookie literally has the warning text... _|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_RestOfCookieHereYouKnow

__ currently on the 7.1.0 version of noblox.js

Please help me out!

Neztore commented 3 years ago

Hi. This is probably a promise/async issue - can I see your code?

This error happens when the library makes a request and setCookie either hasn't been called, or hasn't finished.

Skyknight47 commented 3 years ago

It's a really dumb issue...... For some reason, the logging in value was different from the config.json cookie var name :grimacing: Sorry!