From 07aad6c69ee617d8a11898b4a15237d22c05146c Mon Sep 17 00:00:00 2001 From: Rokojori Date: Mon, 13 Jul 2026 12:33:39 +0200 Subject: [PATCH] auth: refresh token cookie, rate limiting, delete account, welcome email - trust proxy for correct IP behind nginx - refresh token now set as httpOnly cookie alongside access token - GET /api/auth/refresh-session for browser-based token refresh - DELETE /api/auth/me with full cleanup of tokens and cookies - rate limiting on login (10/15min) and register (5/hr) - welcome email on registration (non-blocking) - delete account UI on profile page with two-step confirm Co-Authored-By: Claude Sonnet 4.6 --- source/pages/profile.html | 29 +++++++ source/server/db.ts | 5 ++ source/server/index.ts | 1 + source/server/rateLimiter.ts | 68 +++++++++++++--- source/server/routes/auth.ts | 154 ++++++++++++++++++++++++----------- 5 files changed, 199 insertions(+), 58 deletions(-) diff --git a/source/pages/profile.html b/source/pages/profile.html index 87e8c7b..5e7b847 100644 --- a/source/pages/profile.html +++ b/source/pages/profile.html @@ -76,6 +76,20 @@ + +
+

Delete account

+

This permanently deletes your account and all associated data. It cannot be undone.

+ + +
+