Sha256: 37a2b1fb8a52b386970e149f9948acbb0a4f3f48e7f7c8f9f57085172fefcb0b
Contents?: true
Size: 1003 Bytes
Versions: 19
Compression:
Stored size: 1003 Bytes
Contents
module SocialStream module Oauth2Server module Models module User extend ActiveSupport::Concern included do has_many :oauth2_tokens, dependent: :destroy has_many :authorization_codes, class_name: 'Oauth2Token::AuthorizationCode' has_many :access_tokens, class_name: 'Oauth2Token::AccessToken' has_many :refresh_tokens, class_name: 'Oauth2Token::RefreshToken' end # Is {#client} authorized by this {User} def client_authorized?(client) contact_to!(client).relation_ids.include? Relation::Auth.instance.id end # Create a new tie to {Site::Client} def client_authorize!(client) unless contact_to!(client).relation_ids.include?(Relation::Auth.instance.id) contact_to!(client).relation_ids += [ Relation::Auth.instance.id ] end end end end end end
Version data entries
19 entries across 19 versions & 2 rubygems