Skip to content

Commit

Permalink
Added provider parameter to find_resource (#998)
Browse files Browse the repository at this point in the history
Allow other providers than email in registration
  • Loading branch information
m4-miranda authored and Maicol Bentancor committed Oct 27, 2017
1 parent 6fc1382 commit 915058a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def get_case_insensitive_field_from_resource_params(field)
def find_resource(field, value)
# fix for mysql default case insensitivity
q = "#{field.to_s} = ? AND provider='#{provider.to_s}'"

if ActiveRecord::Base.connection.adapter_name.downcase.starts_with? 'mysql'
q = "BINARY " + q
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class RegistrationsController < DeviseTokenAuth::ApplicationController

def create
@resource = resource_class.new(sign_up_params)
@resource.provider = "email"
@resource.provider = provider

# honor devise configuration for case_insensitive_keys
if resource_class.case_insensitive_keys.include?(:email)
Expand Down

0 comments on commit 915058a

Please sign in to comment.