Skip to content
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

Devise does not return Bad Request for Unpermitted Parameters #4453

Closed
johnson-yeap opened this issue Mar 5, 2017 · 5 comments
Closed

Devise does not return Bad Request for Unpermitted Parameters #4453

johnson-yeap opened this issue Mar 5, 2017 · 5 comments

Comments

@johnson-yeap
Copy link

Hi,

Why does devise not returning 400 Bad Request for unpermitted parameter, but 401 Unauthorized instead.
What's the design paradigm?

Is there a way to customized the return to include Bad Request for Rails strong parameters?

@betesh
Copy link
Contributor

betesh commented Mar 24, 2017

Which controllers are you referring to? ones that inherit from DeviseController? Or ones that require an authenticated user?

@johnson-yeap
Copy link
Author

johnson-yeap commented Mar 25, 2017

@betesh The one that inherits from DeviseController.

I am trying to build an API for user authentication.

When the API calls contains typo like "passod" instead of "password",
I wish to override Devise behavior to return 401 Bad Request.

screenshot from 2017-03-25 22-32-15

@betesh
Copy link
Contributor

betesh commented Mar 27, 2017

What is ActionController::Parameters.action_on_unpermitted_parameters set to for your application?

@tegon
Copy link
Member

tegon commented Dec 7, 2017

Hello @johnson-yeap, thanks for your report.
Are you overriding the default sessions controller? If so, can you provide the code here?

@tegon
Copy link
Member

tegon commented Dec 29, 2017

I'm closing this issue because it has not had recent activity.
If you're still facing this on the latest version, please open a new one with all the information requested in the template.

Thank you!

@tegon tegon closed this as completed Dec 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants