JWT malformed error

I am using authenticatedFetch on the front to send requests to the backend. Sometimes there is a jwt malformed error when the token is being decoded. What needs to be used so that the token is sent correctly to the server?