mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-26 07:37:54 +00:00
The auth probe used to mark a token as failed whenever authenticate threw, so a database error while checking a valid token came back as 401 token_auth_failed, which clients read as "discard this token". The probe now records the thrown error on the request instead. Routes that require auth hand it to the error handler (503 db_unavailable with Retry-After for a database outage, a generic 500 otherwise); routes that don't require auth serve the request anonymously, as before. Only a token that authenticate reports invalid still gets 401 token_auth_failed. The periodic socket re-check likewise keeps a connection up when its lookup fails, instead of disconnecting it.