Sha256: 1bc07e8a33af668c49cfef6017897ee5426832d5b7fc509be1b7a529cfdb90f6
Contents?: true
Size: 699 Bytes
Versions: 5
Compression:
Stored size: 699 Bytes
Contents
# frozen_string_literal: true module SolidusSocial module Spree module UserDecorator def self.prepended(base) base.class_eval do has_many :user_authentications, dependent: :destroy devise :omniauthable end end def apply_omniauth(omniauth) if omniauth.fetch('info', {})['email'].present? self.email = omniauth['info']['email'] if email.blank? end user_authentications.build(provider: omniauth['provider'], uid: omniauth['uid']) end def password_required? (user_authentications.empty? || password.present?) && super end ::Spree.user_class.prepend self end end end
Version data entries
5 entries across 5 versions & 1 rubygems