stytchauth / stytch-node

Official Stytch Backend SDK for Node.js
https://stytch.com
MIT License
90 stars 21 forks source link

Convert OAuth2-style errors to StytchError equivalent #315

Closed logan-stytch closed 7 months ago

logan-stytch commented 7 months ago

Fixes #314

The issue is that the M2M token endpoint conforms to OAuth2-expected field names, which meant they didn't match our existing names from a StytchError -- since an end-user wouldn't particularly care about this difference when using the backend SDK, this PR simply converts the field names from the OAuth2 names to our StytchError names.

Testing

I created a simple script locally to create an M2M client and then try to get a token using a bogus client_secret. Excerpt below: image