mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: basic UI to view user api keys
This commit is contained in:
@ -177,7 +177,7 @@ class Auth::DefaultCurrentUserProvider
|
||||
protected
|
||||
|
||||
def lookup_user_api_user(user_api_key)
|
||||
if api_key = UserApiKey.where(key: user_api_key).includes(:user).first
|
||||
if api_key = UserApiKey.where(key: user_api_key, revoked_at: nil).includes(:user).first
|
||||
if !api_key.write && @env["REQUEST_METHOD"] != "GET"
|
||||
raise Discourse::InvalidAccess
|
||||
end
|
||||
|
Reference in New Issue
Block a user