lib/doorkeeper/oauth/client_credentials/creator.rb in doorkeeper-5.6.0 vs lib/doorkeeper/oauth/client_credentials/creator.rb in doorkeeper-5.6.1
- old
+ new
@@ -11,11 +11,12 @@
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
+ application = client.is_a?(Doorkeeper::Application) ? client : client.application if client
server_config.access_token_model.create_for(
- application: client,
+ application: application,
resource_owner: nil,
scopes: scopes,
**attributes,
)
end