mirror of
https://github.com/neocities/neocities.git
synced 2025-08-04 08:42:00 +02:00
allow api use via current_site, better check for current_site
This commit is contained in:
parent
b89ffc2bad
commit
59dbc1b2e1
5 changed files with 23 additions and 36 deletions
|
@ -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?
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue