mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
FEATURE: Hash user API keys in the database (#9344)
The 'key' column will be dropped in a future commit.
This commit is contained in:
@ -260,7 +260,7 @@ class Auth::DefaultCurrentUserProvider
|
||||
protected
|
||||
|
||||
def lookup_user_api_user_and_update_key(user_api_key, client_id)
|
||||
if api_key = UserApiKey.where(key: user_api_key, revoked_at: nil).includes(:user).first
|
||||
if api_key = UserApiKey.active.with_key(user_api_key).includes(:user).first
|
||||
unless api_key.allow?(@env)
|
||||
raise Discourse::InvalidAccess
|
||||
end
|
||||
|
Reference in New Issue
Block a user