{"action":"created","issue":{"url":"https://api.github.com/repos/plataformatec/devise/issues/3357","labels_url":"https://api.github.com/repos/plataformatec/devise/issues/3357/labels{/name}","comments_url":"https://api.github.com/repos/plataformatec/devise/issues/3357/comments","events_url":"https://api.github.com/repos/plataformatec/devise/issues/3357/events","html_url":"https://github.com/plataformatec/devise/issues/3357","id":51026770,"number":3357,"title":"NoMethodError (undefined method login' for #<ActionDispatch::Request...>","user":{"login":"ArbolEric","id":3526083,"avatar_url":"https://avatars.githubusercontent.com/u/3526083?v=3","gravatar_id":"","url":"https://api.github.com/users/ArbolEric","html_url":"https://github.com/ArbolEric","followers_url":"https://api.github.com/users/ArbolEric/followers","following_url":"https://api.github.com/users/ArbolEric/following{/other_user}","gists_url":"https://api.github.com/users/ArbolEric/gists{/gist_id}","starred_url":"https://api.github.com/users/ArbolEric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArbolEric/subscriptions","organizations_url":"https://api.github.com/users/ArbolEric/orgs","repos_url":"https://api.github.com/users/ArbolEric/repos","events_url":"https://api.github.com/users/ArbolEric/events{/privacy}","received_events_url":"https://api.github.com/users/ArbolEric/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-12-04T20:45:42Z","updated_at":"2015-01-26T19:53:18Z","closed_at":"2015-01-26T19:53:18Z","body":"rails 4.1, devise 3.4\r\n\r\nI can create a user fine. The user just can't sign in (ie problem in POST users/sign_in, Devise::SessionsController#create). Here are some key variables from config/initializers/devise.rb:\r\n\r\n    config.authentication_keys = [ :login ]\r\n    config.request_keys = [ :login ]\r\n    config.http_authenticatable = [false]\r\n\r\n\r\nHere is the form from controllers/sessions/new.html.erb\r\n\r\n    <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>\r\n      <div><%= f.label :login %><br />\r\n      <%= f.email_field :login, autofocus: true %></div>\r\n\r\n      <div><%= f.label :password %><br />\r\n      <%= f.password_field :password, autocomplete: \"off\" %></div>\r\n\r\n      <% if devise_mapping.rememberable? -%>\r\n         <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>\r\n     <% end -%>\r\n\r\n     <div><%= f.submit \"Log in\" %></div>\r\n     <% end %>\r\n\r\nconfig/routes.rb\r\n\r\n      devise_for :users, controllers: {\r\n         sessions: 'users/sessions'\r\n      }\r\n\r\nmodels/User.rb\r\n\r\n     class User < ActiveRecord::Base\r\n       # Include default devise modules. Others available are:\r\n       #  :confirmable, :lockable, :timeoutable and :omniauthable\r\n       devise :database_authenticatable, :registerable,\r\n             :recoverable, :rememberable, :trackable, :validatable,\r\n             :authentication_keys => [:login]\r\n         \r\n       attr_accessor :login\r\n    ....\r\n    end\r\n\r\nHere are the parameters submitted:\r\n\r\n    {\"utf8\"=>\"✓\", \r\n        \"authenticity_token\"=>\"yada\",\r\n        \"user\"=>{\"login\"=>\"me@example.org\", \r\n          \"password\"=>\"[FILTERED]\", \r\n          \"remember_me\"=>\"0\"}, \r\n        \"commit\"=>\"Log in\"}\r\n\r\nI ended up solving my issue by changing lib/devise/strategies/authenticable.rb#148 to:\r\n\r\n          def request_values\r\n            keys = request_keys.respond_to?(:keys) ? request_keys.keys : request_keys\r\n            values = keys.map { |k| self.request[self.scope][k] }\r\n            Hash[keys.zip(values)]\r\n          end\r\n\r\nYou can view the full stacktrace on [Stackoverflow](http://stackoverflow.com/questions/27215888/rails-4-devise-db-sign-in-nomethoderror-login-for-actiondispatchrequest).\r\n\r\nIs this something I should create a pull request for??\r\n"},"comment":{"url":"https://api.github.com/repos/plataformatec/devise/issues/comments/71525830","html_url":"https://github.com/plataformatec/devise/issues/3357#issuecomment-71525830","issue_url":"https://api.github.com/repos/plataformatec/devise/issues/3357","id":71525830,"user":{"login":"lucasmazza","id":80978,"avatar_url":"https://avatars.githubusercontent.com/u/80978?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasmazza","html_url":"https://github.com/lucasmazza","followers_url":"https://api.github.com/users/lucasmazza/followers","following_url":"https://api.github.com/users/lucasmazza/following{/other_user}","gists_url":"https://api.github.com/users/lucasmazza/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasmazza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasmazza/subscriptions","organizations_url":"https://api.github.com/users/lucasmazza/orgs","repos_url":"https://api.github.com/users/lucasmazza/repos","events_url":"https://api.github.com/users/lucasmazza/events{/privacy}","received_events_url":"https://api.github.com/users/lucasmazza/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T19:53:18Z","updated_at":"2015-01-26T19:53:18Z","body":"Closing this one since it isn't a real issue with Devise and this is the expected behavior."}}