Merge branch 'bn_launcher_integration' of https://github.com/bigbluebutton/greenlight2 into bn_launcher_integration

This commit is contained in:
bruckwubete
2018-07-04 15:36:06 -04:00
18 changed files with 90 additions and 59 deletions

View File

@ -23,8 +23,8 @@ class User < ApplicationRecord
# Generates a user from omniauth.
def from_omniauth(auth)
find_or_initialize_by(social_uid: auth['uid'], provider: auth['provider']).tap do |u|
u.name = send("#{auth['provider']}_name", auth)
u.username = send("#{auth['provider']}_username", auth)
u.name = send("#{auth['provider']}_name", auth) unless u.name
u.username = send("#{auth['provider']}_username", auth) unless u.username
u.email = send("#{auth['provider']}_email", auth)
u.image = send("#{auth['provider']}_image", auth)
u.save!