Read params values from request header in different formats #1034
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently if the authentication parameters for sign_up/sign_in/account_update are sent in
paramshash, the values can be parsed and whitelisted without any issue. But if the parameters are set in http header before sending to the api, they are not available inparamshash. Then values are looked up in the request header and assigned toparamsaccordingly.In our case, we sent the parameters e.g. which are required for
sign_up(email,password,password_confirmation) in the header from Postman and some other client-side application. But for some reason,paramswas able to read only the first 2 fields (email and password) and thus creating the user anyway thoughpassword_confirmationdoes not match withpassword. After some investigation, we found that its available asHTTP_PASSWORD_CONFIRMATIONinstead ofpassword_confirmationto read fromrequest.headers.But in specs, if we send the same field in the
headershash, it becomes available with the same name inrequest.headers. This PR will solve issues in both cases.