title: invalid email or password in devise
body: <p>It is very strange type error I have user and want to sign in through devise but I am facing strange error. I sign up successfully but when I try to login it through and error of invalid email or password here is may some code.</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
      before_filter :update_sanitized_params, if: :devise_controller?
      protected
      def update_sanitized_params
  
       devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:email,   :password, :password_confirmation, :role)}
       devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:email, :password) }
     end   
  
  
   end
  </code></pre>
  
  <p>My form is</p>
  
  <pre><code>&lt;h2&gt;Sign in&lt;/h2&gt;
  
  &lt;%= form_for(resource, :as =&gt; resource_name, :url =&gt; user_session_path(resource_name)) do |f| %&gt;
    &lt;div&gt;&lt;%= f.label :email %&gt;&lt;br /&gt;
    &lt;%= f.email_field :email, :autofocus =&gt; true %&gt;&lt;/div&gt;
  
    &lt;div&gt;&lt;%= f.label :password %&gt;&lt;br /&gt;
    &lt;%= f.password_field :password %&gt;&lt;/div&gt;
  
    &lt;% if devise_mapping.rememberable? -%&gt;
      &lt;div&gt;&lt;%= f.check_box :remember_me %&gt; &lt;%= f.label :remember_me %&gt;&lt;/div&gt;
    &lt;% end -%&gt;
  
     &lt;div&gt;&lt;%= f.submit "Sign in" %&gt;&lt;/div&gt;
  &lt;% end %&gt;
  
  &lt;%= render "devise/shared/links" %&gt;
  </code></pre>
  
  <p>and my devise.rb has following contents</p>
  
  <pre><code> config.authentication_keys = [ :email ]
   config.case_insensitive_keys = [ :email ]
   config.strip_whitespace_keys = [ :email ]
   config.reconfirmable = true
   config.password_length = 8..128
   config.reset_password_within = 6.hours
   config.sign_out_via = :delete
  </code></pre>
  
  <p>here is log</p>
  
  <pre><code>Started POST "/users/sign_in.user" for 127.0.0.1 at 2014-02-11 10:52:50 +0500
  Processing by Devise::SessionsController#create as 
    Parameters: {"utf8"=&gt;"✓",    "authenticity_token"=&gt;"SRARjzpSBMAck6qAOXHj4f4ycjYXX/1tYWoVrDhhylA=", "user"=&gt;{"email"=&gt;"asnad321@gmail.com", "password"=&gt;"[FILTERED]", "remember_me"=&gt;"0"}, "commit"=&gt;"Sign in"}
    User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE `users`.`email` = 'asnad321@gmail.com' ORDER BY `users`.`id` ASC LIMIT 1
  Completed 401 Unauthorized in 77ms
  </code></pre>