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?

View file

@ -64,15 +64,6 @@ end
post '/create' do
content_type :json
if banned?(true)
signout
session[:banned] = true if !session[:banned]
flash[:error] = 'There was an error, please <a href="/contact">contact support</a> to log in.'
redirect '/'
end
dashboard_if_signed_in
@site = Site.new(