fnbrjs / fnbr.js

A library to interact with Epic Games' Fortnite HTTP and XMPP services
https://fnbr.js.org
MIT License
128 stars 34 forks source link

errors.com.epicgames.common.missing_permission error #774

Closed faroukbmiled closed 2 months ago

faroukbmiled commented 2 months ago

Can't figure out what im doing wrong!

In the previous fnbr v3.1.6 i used to do

const token = client.auth.auths.get("fortnite").token;
console.log(token)

and that token works in pretty much every api (including matchmaking, and it still works to this day)

in v4.0.0 i do

const token = client.auth.sessions.get("fortnite").accessToken;
console.log(token)

but this token throws in matchmaking service api ,the same api as before (both tokens look very similar)

 403 {
  errorCode: 'errors.com.epicgames.common.missing_permission',
  errorMessage: "Sorry your login does not posses the permissions 'fortnite:profile:undefined:commands ALL' needed to perform the requested operation",
  messageVars: [ 'fortnite:profile:undefined:commands', 'ALL' ],
  numericErrorCode: 1023,
  originatingService: 'fortnite',
  intent: 'prod-live'
}

i very much could be doing something wrong, help is greatly appreciated

faroukbmiled commented 2 months ago

Nevermind the issue was unrelated to the token itself Issue was i was using the old "client.user.id" in the api link as a query parameter which is returning "undefined" fixed by changing "client.user.id" to "client.user.self.id"