diff --git a/lib/ontologies_linked_data/models/users/oauth_authentication.rb b/lib/ontologies_linked_data/models/users/oauth_authentication.rb index d7cc1cba..99aec5a4 100644 --- a/lib/ontologies_linked_data/models/users/oauth_authentication.rb +++ b/lib/ontologies_linked_data/models/users/oauth_authentication.rb @@ -61,6 +61,7 @@ def sync_providers_id(user, github_id, orcid_id) def auth_create_user(user_data) user = User.new(user_data) + user.username = user.username.to_s.split('@').first || user.username user.password = SecureRandom.hex(16) return nil unless user.valid?