allow api use via current_site, better check for current_site

This commit is contained in:
Kyle Drake 2024-02-16 10:50:36 -06:00
parent b89ffc2bad
commit 59dbc1b2e1
5 changed files with 23 additions and 36 deletions

View file

@ -183,6 +183,8 @@ post '/api/:name' do
end
def require_api_credentials
return true if current_site
if !request.env['HTTP_AUTHORIZATION'].nil?
init_api_credentials
api_error(403, 'email_not_validated', 'you need to validate your email address before using the API') if email_not_validated?