I’m using Devise to set up user authentication, but I’m having difficulty getting users to sign in.
The forms are rendering correctly for sign in and sign up. The problem is that when I click submit, I get a (No route matches “/sessions/user”) error. If I go to the sign up form, fill in the fields, and submit, then I get the same error. However, when I go back to the root url (pages#home) the user is signed in. If I log out, and try to sign in with the same user credentials, I get the no route matches error and the user is not signed in at all.
I’d like to fix this so that sign up/sign in redirects to pages#home and the user gets signed in from the sign in form. Any ideas?
Please let me know if any additional info is needed, and thank you very much for your help!
I had an old sessions controller, deleted it, restarted server. Then I got a ‘BCrypt::Errors::InvalidHash in Devise/sessionsController#create’ error on sign in, which relates to an empty encrypted_password db column. I looked at the user model and commented out attr_accessor :password and created a new user, the encrypted_password for that user was saved, and sign in now works. Hooray!!