mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
add support for hidden api keys, used in hosting scenarios
This commit is contained in:
@ -12,7 +12,7 @@ class ApiKey < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def self.create_master_key
|
||||
api_key = ApiKey.find_by(user_id: nil)
|
||||
api_key = ApiKey.find_by(user_id: nil, hidden: false)
|
||||
if api_key.blank?
|
||||
api_key = ApiKey.create(key: SecureRandom.hex(32), created_by: Discourse.system_user)
|
||||
end
|
||||
|
Reference in New Issue
Block a user