Summary
When client-credentials token refresh fails with a non-auth API error (e.g. 500), Credentials.refreshAccessToken() mutates an existing FgaApiError instance by assigning constructor, name, and auth fields.
Impact
Mutating object properties does not change the prototype chain, so instanceof FgaApiAuthenticationError fails even though the error is intended to be treated as authentication failure.
Expected
Token-refresh failures should throw a real FgaApiAuthenticationError instance with auth context.
Proposed Fix
Construct and throw a new FgaApiAuthenticationError (or equivalent wrapper) instead of mutating an existing error object.