FIX: Downcase email coming back from auth-provider
This commit is contained in:
parent
c628166bb4
commit
296cdc53ee
|
@ -18,6 +18,10 @@ class Auth::Result
|
|||
@failed = false
|
||||
end
|
||||
|
||||
def email
|
||||
@email.downcase
|
||||
end
|
||||
|
||||
def failed?
|
||||
!!@failed
|
||||
end
|
||||
|
|
|
@ -90,6 +90,11 @@ describe Auth::ManagedAuthenticator do
|
|||
end
|
||||
|
||||
describe 'match by email' do
|
||||
it 'downcases the email address from the authprovider' do
|
||||
result = authenticator.after_authenticate(hash.deep_merge(info: { email: "HELLO@example.com" }))
|
||||
expect(result.email).to eq('hello@example.com')
|
||||
end
|
||||
|
||||
it 'works normally' do
|
||||
user = Fabricate(:user)
|
||||
result = authenticator.after_authenticate(hash.deep_merge(info: { email: user.email }))
|
||||
|
|
Loading…
Reference in New Issue