7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/doorkeeper/oauth/client_credentials/creator.rb', line 7
def call(client, scopes, attributes = {})
existing_token = nil
if lookup_existing_token?
existing_token = find_active_existing_token_for(client, scopes)
return existing_token if server_config.reuse_access_token && existing_token&.reusable?
end
with_revocation(existing_token: existing_token) do
server_config.access_token_model.create_for(
application: client,
resource_owner: nil,
scopes: scopes,
**attributes,
)
end
end
|