-
Notifications
You must be signed in to change notification settings - Fork 240
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
User can't be saved. Keep getting 422 error #266
Comments
Hello @codeundercoverdev, The authenticity token is a mechanism to prevent cross-site request forgeries (CSRF) and is not related with authentication (which involves an authentication token). You'll find more details in this question and the CSRF documentation in the Rails guides. I'll close this issue, don't hesitate to ask more questions in #37 if needed - keeping all the related question in the same thread makes easier to others to find them : ) |
Hi @gonzalo-bulnes , Can you please reopen this issue? It has nothing to do with authenticity tokens as in my application controller I disable the authenticity token:
|
I still don't see the relation of the error with Simple Token Authentication... what happens if you remove entirely the If the same error still happens (I would be surprised if it didn't), then I would suggest trying to move the authenticity token verification skipping after the If the error doesn't happen anymore, then I am certainly missing something. In that case, please see this wiki article; it provides a systematic way to provide the context that is necessary to debug token authentication issues and will help you and me finding what we are missing. |
Hi @codeundercoverdev, any news on this issue? |
I have this same problem. the issue (as far as I can tell) is that the params being sent back to rails have the object data inside a key called "registration" while devise is looking for params inside a key called "user" I have no idea why the params are being put inside "registration" |
I am trying to use simple_token_authentication on top of devise for both a web app and an api. Here are the routes:
Here is the registrations controller:
Here is my ajax command:
The command returns a 422-unprocessable entity error with the following body:
Here are the logs:
Why is this happening? How do I create a user through the api?
The text was updated successfully, but these errors were encountered: