Skip to content

Commit 915058a

Browse files
m4-mirandaMaicol Bentancor
authored andcommitted
Added provider parameter to find_resource (#998)
Allow other providers than email in registration
1 parent 6fc1382 commit 915058a

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

app/controllers/devise_token_auth/concerns/resource_finder.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def get_case_insensitive_field_from_resource_params(field)
1515
def find_resource(field, value)
1616
# fix for mysql default case insensitivity
1717
q = "#{field.to_s} = ? AND provider='#{provider.to_s}'"
18-
1918
if ActiveRecord::Base.connection.adapter_name.downcase.starts_with? 'mysql'
2019
q = "BINARY " + q
2120
end

app/controllers/devise_token_auth/registrations_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class RegistrationsController < DeviseTokenAuth::ApplicationController
77

88
def create
99
@resource = resource_class.new(sign_up_params)
10-
@resource.provider = "email"
10+
@resource.provider = provider
1111

1212
# honor devise configuration for case_insensitive_keys
1313
if resource_class.case_insensitive_keys.include?(:email)

0 commit comments

Comments
 (0)