Sha256: 106c1609e72dea24316cf19cbc797e606fd9921422075aca8f7779b1e305760d
Contents?: true
Size: 785 Bytes
Versions: 38
Compression:
Stored size: 785 Bytes
Contents
module Maestrano module SSO module Group def find_for_maestrano_auth(auth) # E.g with Rails # where(auth.slice(:provider, :uid)).first_or_create do |group| # group.provider = auth[:provider] # group.uid = auth[:uid] # group.name = (auth[:info][:company_name] || 'Your Group') # group.country = auth[:info][:country] # end raise NoMethodError, "You need to override find_for_maestrano_auth in your #{self.class.name} model" end def maestrano? if self.respond_to?(:provider) return self.provider.to_s == 'maestrano' else raise NoMethodError, "You need to override maestrano? in your #{self.class.name} model" end end end end end
Version data entries
38 entries across 38 versions & 2 rubygems