closes Retrospring/bugs#17
This commit is contained in:
parent
20101e4213
commit
ef4fd30cd9
|
@ -68,7 +68,7 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.find_first_by_auth_conditions(warden_conditions)
|
||||
conditions = warden_conditions.dup.to_h
|
||||
conditions = warden_conditions.dup
|
||||
if login = conditions.delete(:login)
|
||||
where(conditions).where(["lower(screen_name) = :value OR lower(email) = :value", { :value => login.downcase }]).first
|
||||
else
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
|
||||
= devise_error_messages!
|
||||
|
||||
= f.text_field :screen_name, autofocus: true, label: "User name"
|
||||
= f.text_field :login, autofocus: true, label: "User name"
|
||||
= f.submit "Send me password reset instructions"
|
||||
|
||||
= render "devise/shared/links"
|
||||
|
|
|
@ -181,7 +181,7 @@ Devise.setup do |config|
|
|||
# ==> Configuration for :recoverable
|
||||
#
|
||||
# Defines which key will be used when recovering the password for an account
|
||||
config.reset_password_keys = [ :screen_name ]
|
||||
config.reset_password_keys = [ :login ]
|
||||
|
||||
# Time interval you can reset your password with a reset password key.
|
||||
# Don't put a too small interval or your users won't have the time to
|
||||
|
|
Loading…
Reference in New Issue