Land #13782, Allow a jsonrpc token to be used when a database is present

This commit is contained in:
adfoster-r7 2020-06-29 18:27:30 +01:00 committed by GitHub
commit d513ff32d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -39,15 +39,15 @@ module Msf::WebServices
before do
db = get_db
@@auth_initialized = false
if db_initialized(db)
# store DBManager in request environment so that it is available to Warden
request.env['msf.db_manager'] = db
@@auth_initialized ||= get_db.users({}).count > 0
elsif !settings.api_token.nil?
end
if !settings.api_token.nil?
@@auth_initialized = true
request.env['msf.api_token'] = settings.api_token
else
@@auth_initialized = false
end
# store flag indicating whether authentication is initialized in the request environment