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