Closed flackenstein closed 11 months ago
This sounds like a bug in your server. What server is this?
Net Documents API -- it's a legal documents platform. They have a few idiosyncrasies in how they implement OAuth which are easy to work around, but this was the only issue to cause a problem.
Actually i think you might be confused. Neither that line nor that file exists in this project. I think this client would handle expires_in as a string (wrong as it may be lol)
If the authentication server client_credentials response has the expires_in formatted as a string grant_base.ts will throw an error.
Body Example: { access_token: "/DsAH2ykgeGGfbLY7GEhduWMCc9H0Gih1XVrUZQaeNJNJONEWJm0uuZpmrXSK5mzMXC5jEXSJVjYpF+Xy6FRdarw646T+4pPaJ5KMawlaVY=", expires_in: "2700", token_type: "Bearer", }
Code block at line 114 in grant_base.ts:
if ( body.expires_in !== undefined && typeof body.expires_in !== "number" ) { throw new TokenResponseError( "expires_in is not a number", response, ); }
Testing for both number and string would handle this situation and in the tokens.expiresIn assignment below convert type from string to number if needed.