A platform for community discussion. Free, open, simple.
FIX: Downcase email coming back from auth-provider
Blake Erickson296cdc53ee41
diff --git a/lib/auth/result.rb b/lib/auth/result.rbindex 8ad478c2921..d825758433f 100644--- a/lib/auth/result.rb+++ b/lib/auth/result.rb@@ -18,6 +18,10 @@ class Auth::Result@failed = falseend+ def email+ @email.downcase+ end+def failed?!!@failedenddiff --git a/spec/components/auth/managed_authenticator_spec.rb b/spec/components/auth/managed_authenticator_spec.rbindex ba463ed44e4..84889de712f 100644--- a/spec/components/auth/managed_authenticator_spec.rb+++ b/spec/components/auth/managed_authenticator_spec.rb@@ -90,6 +90,11 @@ describe Auth::ManagedAuthenticator doenddescribe 'match by email' do+ it 'downcases the email address from the authprovider' do+ result = authenticator.after_authenticate(hash.deep_merge(info: { email: "[email protected]" }))+ expect(result.email).to eq('[email protected]')+ end+it 'works normally' douser = Fabricate(:user)result = authenticator.after_authenticate(hash.deep_merge(info: { email: user.email }))