Help with fixing error 403 for js

so I am trying to get my X-CSRF-TOKEN by posting in ‘https://www.roblox.com/favorite/toggle’ and getting the header from the response, my problem is I have encountered error 403, which when I tried doing the same thing in python some time ago (Help with fixing error 403 - #10 by SoQueroChocolate) worked for retrieving my X-CSRF-TOKEN, however in javascript it doesn’t seem to, does anyone know what I am doing wrong?

code below:

document.cookie = ‘.ROBLOSECURITY=mycookie’;

var options = {
  credentials : 'include',
  method: 'POST',
  mode:'no-cors',
  body : '',
}

fetch('https://www.roblox.com/favorite/toggle', options).then( response => response.json() ).then( response => {
    console.log(response.message)
  } );
1 Like

Have you verified that the API endpoint is still providing an X-CSRF-TOKEN as one of its headers?

1 Like