diff --git a/app/controllers/saml_controller.rb b/app/controllers/saml_controller.rb index ca8bb572..2437706a 100644 --- a/app/controllers/saml_controller.rb +++ b/app/controllers/saml_controller.rb @@ -17,7 +17,7 @@ def consume if response.is_valid? email = response.name_id session[:nameid] = response.name_id - user = User.find_by_email(email) + user = User.find_by("LOWER(email) = ?", email.strip.downcase) unless user password = [*'0'..'9', *'a'..'z', *'A'..'Z', *'!'..'?'].sample(16).join user = User.create!(email:, password:, password_confirmation: password)