Skip to content

A platform for community discussion. Free, open, simple.

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

Simon Cossarb3e8fbe7d4a7
diff --git a/app/models/user.rb b/app/models/user.rb
index ccd5928853a..2ecea38aade 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -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