mirror of
https://github.com/neocities/neocities.git
synced 2025-08-04 16:51:36 +02:00
track api call counts that require auth
This commit is contained in:
parent
cd94d2ce36
commit
02cea425e9
3 changed files with 29 additions and 2 deletions
|
@ -131,6 +131,8 @@ def init_api_credentials
|
|||
api_error_invalid_auth
|
||||
end
|
||||
|
||||
DB['update sites set api_calls=api_calls+1 where id=?', site.id].first
|
||||
|
||||
session[:id] = site.id
|
||||
else
|
||||
api_error_invalid_auth
|
||||
|
@ -163,4 +165,4 @@ end
|
|||
|
||||
def api_not_found
|
||||
api_error 404, 'not_found', 'the requested api call does not exist'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue