Build `primary_email` association directly in `DiscourseSingleSignOn`.

This commit is contained in:
Guo Xiang Tan 2018-03-20 19:36:35 +08:00
parent 28baf97a00
commit d0e7898fa0
1 changed files with 1 additions and 1 deletions

View File

@ -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