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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user