clerk / clerk-sdk-ruby

Access the Clerk Backend API from Ruby
MIT License
24 stars 10 forks source link

fix: Use JSON Content-Type in mutating requests #29

Closed agis closed 1 year ago

agis commented 1 year ago

The Backend API supports both form-urlencoded and application/json content types in requests. However, we're slowly fading out support for form-urlencoded and transitioning to application/json.

Most important, the Ruby SDK generated payloads that the Backend API couldn't properly unmarshal, particularly in the case of payloads like the following:

{ backup_codes: ["abcdef", "zxcqwe"] }

in such cases, the resulting payload would be:

backup_codes[]: "abcdef; zxcqwe"

which the Backend API didn't know how to properly parse.

Fixes AUTH-129

agis commented 1 year ago

question Is the jwt and minitest bump dependencies relevant with change in content-type ? Also why we updated the version to beta2 ?

These are only used while developing the gem and doesn't affect the resulting package. The Gemfile.lock was out-of-date, so I updated it by doing bundle install. The beta2 was also the result of the outdated Gemfile.lock, but all of these are unrelated to this fix and don't affect the resulting package.