FIX: downcase SSO external email before checking against Discourse email (#8306)

* Downcase single_sign_on_record.external_email before checking against Discourse email

* Use &.downcase
This commit is contained in:
Simon Cossar 2019-11-07 12:26:28 -05:00 committed by GitHub
parent 54fe887c44
commit b3e8fbe7d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -908,7 +908,7 @@ class User < ActiveRecord::Base
def email_confirmed?
email_tokens.where(email: email, confirmed: true).present? ||
email_tokens.empty? ||
single_sign_on_record&.external_email == email
single_sign_on_record&.external_email&.downcase == email
end
def activate