feat(auth): wire up refresh token endpoint and auto-refresh

- Add POST /api/refresh-token endpoint to router
- Auth store now calls refreshTokenIfNeeded on init and every hour
- Token refreshes automatically when within 2 weeks of expiry
This commit is contained in:
2026-02-17 21:54:45 +00:00
parent e20263b717
commit 1082631525
2 changed files with 10 additions and 0 deletions
+2
View File
@@ -99,6 +99,8 @@ func main() {
r.Group(func(r chi.Router) {
r.Use(mw.RequireAuth)
r.Post("/refresh-token", authHandlers.RefreshTokenHandler)
r.Get("/user/profile", user.GetProfileHandler)
r.Put("/user/profile", user.UpdateProfileHandler)
r.Delete("/user/account", user.DeleteAccountHandler)