Sha256: 12bd4160098dc2f7973c2ee88046729ed81ee9761b18bc820f21b60c24fc5171

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 KB

Contents

require 'mongoid'

module DoorkeeperSsoClient
  module Mixins
    module Mongoid
      module Passport
        extend ActiveSupport::Concern

        include ::Mongoid::Document
        include ::Mongoid::Timestamps
        include ::DoorkeeperSsoClient::Mixins::PassportBase

        included do
          field :identity_id, type: Integer
          field :identity_type, type: String
          field :secret, type: String
          field :state, type: String
          field :chip, type: String
          field :verified, type: Boolean, default: false
          field :modified, type: Boolean, default: false
          field :created_at, type: DateTime
          field :updated_at, type: DateTime
          field :uid, type: String
          field :token, type: String
          field :refresh_token, type: String
          field :token_expiry, type: DateTime
          field :revoked_at, type: DateTime
          field :revoke_reason, type: String
          field :last_login_at, type: DateTime
          field :mobile_token, type: String
          field :client_uid, type: String
        end

        module ClassMethods
          def find_by_uid(uid)
            passport = where(uid: uid).first
          end
        end # ClassMethods
      end # Passport
    end # Mongoid
  end # Mixins
end # DoorkeeperSsoClient

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
doorkeeper_sso_client-0.4.10 lib/doorkeeper_sso_client/mixins/mongoid/passport.rb