Class: Doorkeeper::OAuth::ClientCredentialsRequest::Creator

Inherits:
Object
  • Object
show all
Defined in:
lib/doorkeeper/oauth/client_credentials/creator.rb

Instance Method Summary collapse

Instance Method Details

#call(client, scopes, attributes = {}) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/doorkeeper/oauth/client_credentials/creator.rb', line 5

def call(client, scopes, attributes = {})
  existing_token = existing_token_for(client, scopes)
  if existing_token
    return existing_token if existing_token.accessible?
    existing_token.revoke
  end
  create(client, scopes, attributes)
end