mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 08:43:25 +08:00
DEV: Do not log API key scope and/or source-ip mismatches (#15423)
Using an incorrectly-scoped API key is something which should be fixed by the client - no need to log errors on the server-side.
This commit is contained in:
parent
ad25e4103d
commit
4f06c24a57
|
@ -369,8 +369,7 @@ class Auth::DefaultCurrentUserProvider
|
|||
if api_key = ApiKey.active.with_key(api_key_value).includes(:user).first
|
||||
api_username = header_api_key? ? @env[HEADER_API_USERNAME] : request[API_USERNAME]
|
||||
|
||||
unless api_key.request_allowed?(@env)
|
||||
Rails.logger.warn("[Unauthorized API Access] username: #{api_username}, IP address: #{request.ip}")
|
||||
if !api_key.request_allowed?(@env)
|
||||
return nil
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user