Sha256: a7fa3c3f359cfac4ad91d4cee5c28ccc4f713817f5a5fa8bb5e7f91ec9bc008a
Contents?: true
Size: 1.16 KB
Versions: 3
Compression:
Stored size: 1.16 KB
Contents
module Doorkeeper module OAuth class PasswordAccessTokenRequest include Validations include OAuth::RequestConcern include OAuth::Helpers validate :client, error: :invalid_client validate :resource_owner, error: :invalid_grant validate :scopes, error: :invalid_scope attr_accessor :server, :client, :resource_owner, :parameters, :access_token def initialize(server, client, resource_owner, parameters = {}) @server = server @resource_owner = resource_owner @client = client @parameters = parameters @original_scopes = parameters[:scope] end private def before_successful_response find_or_create_access_token(client, resource_owner.id, scopes, server) end def validate_scopes return true unless @original_scopes.present? ScopeChecker.valid? @original_scopes, server.scopes, client.try(:scopes) end def validate_resource_owner !!resource_owner end def validate_client !parameters[:client_id] || !!client end end end end
Version data entries
3 entries across 3 versions & 1 rubygems