Sha256: 7cde0489a9f3b0cfe99c20887bac7aac8030f6c9c7764aaf4b95369a8ef875ae
Contents?: true
Size: 760 Bytes
Versions: 9
Compression:
Stored size: 760 Bytes
Contents
# frozen_string_literal: true module Doorkeeper module OAuth class ClientCredentialsRequest < BaseRequest class Creator def call(client, scopes, attributes = {}) existing_token = existing_token_for(client, scopes) if Doorkeeper.configuration.reuse_access_token && existing_token&.reusable? return existing_token end existing_token&.revoke AccessToken.find_or_create_for( client, nil, scopes, attributes[:expires_in], attributes[:use_refresh_token] ) end private def existing_token_for(client, scopes) Doorkeeper::AccessToken.matching_token_for client, nil, scopes end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems