I am trying to setup devise in my rails app. It was working nicely, but now I am not able to login as any of my users I get 'Invalid email or password.' I would like to get more insight why its not authenticating.
Is there any devise configuration settings that shed some more light? i.e. what is the query being used to find the user, et c ...
Thanks!
Warden is a gem that takes care of fetching authentication details from the request and fetching the user. Devise requires Warden to be added as a middleware.
Warden is a Ruby gem that allows you to perform authentication through Rack Middleware. When you're writing an application's authentication from scratch it's normal to do this entirely within the application but there are several advantages to using Warden.
Normally Devise not provide an accurate logging system, maybe overriding the default controller you can catch what is going wrong. Try something like this:
# app/controllers/sessions_controller.rb
class SessionsController < Devise::SessionsController
def new
super # or perform some custom task
end
end
Remember then to configure the routes too.
# app/config/routes.rb
devise_for :users, :controllers => {:sessions => "sessions"}
For more details about the default Devise sessions controller take a look at this: https://github.com/plataformatec/devise/blob/master/app/controllers/devise/sessions_controller.rb
OR
You can login with ssh to your remote server, run rails console
and do manually some checks (check that users exist, try a login via console,...), alternatively you can create a rake task with some testing and run remotely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With