-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change POST request to url #142
Comments
In previous versions they were the same but it was hard to understand what was actually sent to the server. I changed it to be this way in the latest version. |
Yes, this is the right decision, but can tell me how to bring these headlines to that value, just on the backend this module and it does not work for another |
You can merge all of the object to a single one, but there will also be some name changes (snake-case to camel-case in some variables and the "scope" variable is concatinated in the authorizationData in the way defined by the provider settings. Object.keys(req.body).reduce((acc, key) => ({...acc, ...req.body[key]}), {}) //this will merge every key to every value; or if you want a less general and more understandable code { ...req.body.authorizationData, ...req.body.oauthData, ...req.body.userData } if you have missing properties or properties in the wrong shape after that you'll have to try and fix each one of them manually. |
@ronzeidman Hey, I can see your decision to semantically distribute the keys but it breaks some of the libraries out there. Like django-rest-auth which tries to fetch from request body directly. https://github.com/Tivix/django-rest-auth/blob/master/rest_auth/registration/serializers.py#L85 Anyways, Can you explain the above solution a bit? or a example app maybe? |
@navneet35371 I see what you mean, maybe it should be configurable. Anyway in the meantime can you add a simple middleware for the routes handled by the django-rest-auth library to merge the body's properties (probably you only need to merge the oauthData with the userData) |
satellizer had such requests, but here they are slightly different
Is it possible to bring them to the first value?
The text was updated successfully, but these errors were encountered: