Module: Mumukit::Login::Profile
- Defined in:
- lib/mumukit/login/profile.rb
Class Method Summary collapse
Class Method Details
.from_omniauth(omniauth) ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/mumukit/login/profile.rb', line 2 def self.from_omniauth(omniauth) struct provider: omniauth.provider, first_name: omniauth.info.first_name, last_name: omniauth.info.last_name, social_id: omniauth.uid, email: omniauth.info.email, uid: generate_uid(omniauth), image_url: omniauth.info.image end |
.generate_uid(omniauth) ⇒ Object
12 13 14 |
# File 'lib/mumukit/login/profile.rb', line 12 def self.generate_uid(omniauth) omniauth.info.email || omniauth.uid end |