noblox / noblox.js

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

[BUG] refreshCookie() fails #835

Closed Faf4a closed 4 weeks ago

Faf4a commented 1 month ago

Describe the bug refreshCookie() fails to refresh the token provided.

To Reproduce

const rbx = require("noblox.js");
async function startApp() {
  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.|..."
  );
  let currentUser = await rbx.getAuthenticatedUser();
  console.log(currentUser);
  rbx.refreshCookie(
    "_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|..."
  );
}
startApp();

TypeError: Cannot read properties of null (reading '1') at node_modules.pnpm\noblox.js@6.0.2\node_modules\noblox.js\lib\util\refreshCookie.js:42:74 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)


**Expected behavior**
Returning a new cookie.

**Additional context**
Upon further investigation, I noticed that the `ROBLOXCOOKIE` is no longer accessible via `https://www.roblox.com/authentication/signoutfromallsessionsandreauthenticate`.

This is returned instead:

rbx-ip2=1; domain=roblox.com; expires=Mon, 30-Sep-2024 06:11:21 GMT; path=/, RBXEventTrackerV2=CreateDate=09/30/2024 00:11:21; domain=roblox.com; expires=Fri, 16-Feb-2052 05:11:21 GMT; path=/, GuestData=UserID=-userid; domain=.roblox.com; expires=Fri, 16-Feb-2052 05:11:21 GMT; path=/

commonly-ts commented 4 weeks ago

I would just like to note that refreshCookie is a deprecated function. Non-expiring cookies can be generated via logging in incognito mode.

alanbixby commented 4 weeks ago

This is a deprecated function pending removal from the library. This behavior is not a bug.