diff --git a/app/models/discourse_single_sign_on.rb b/app/models/discourse_single_sign_on.rb index 1d7b041805d..f25a7164317 100644 --- a/app/models/discourse_single_sign_on.rb +++ b/app/models/discourse_single_sign_on.rb @@ -135,7 +135,7 @@ class DiscourseSingleSignOn < SingleSignOn try_username = username.presence user_params = { - email: email, + primary_email: UserEmail.new(email: email, primary: true), name: try_name || User.suggest_name(try_username || email), username: UserNameSuggester.suggest(try_username || try_name || email), ip_address: ip_address