Kyoso-Team / kyoso

A web application that takes osu! tournaments beyonds spreadsheets.
http://kyoso.sh
GNU Affero General Public License v3.0
1 stars 1 forks source link

Create API route that deletes sessions older than 7 days #72

Open L-Mario564 opened 2 weeks ago

L-Mario564 commented 2 weeks ago

Create an API endpoint at api/crons/delete_old_sessions and via a DELETE request, the sessions that were last active more than 7 days ago will be deleted from the database. The only condition is that the Authorization header must equal to Bearer ${env.CRON_SECRET} (CRON_SECRET needs to be added to .env.example right below JWT_SECRET).

This route will run via a cron job I've yet to implement/host (this last bit is something I'll do).