-
Notifications
You must be signed in to change notification settings - Fork 68
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
500 error when user not exist #85
Comments
On which part of the code is this failing?, I would say on the |
So when the email does not exist in the ActiveRecord, it will throw out a 500 internal server error instead of a 422 Invalid email or password error. |
I think the user variable is nil, somehow, can you confirm this? |
I can verify the login if the user exist in the database, which I don't think it's nil, right? |
I think you are getting the |
I'm working on the log in with sessions_controller, so my create function looks like this:
So when the user does not exist, I got a 500 error instead of a 422. Any ideas? I tried
rescue ActiveRecord::RecordNotFound
but it's not working for me.The text was updated successfully, but these errors were encountered: