feat(accounts): add admin accounts and user preferences

Remove public registration, support administrator-managed accounts, and persist personal preferences.

Refs #2 #5

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 19:54:06 +01:00
parent 1b0625f91c
commit 50bde816ed
46 changed files with 1362 additions and 256 deletions

View File

@ -28,13 +28,14 @@ func SetupRouter(h *handlers.Handler, jwtSecret string) *gin.Engine {
// Auth public
api.POST("/auth/login", h.Login)
api.POST("/auth/register", h.Register)
// Routes authentifiées
authed := api.Group("/")
authed.Use(auth.Middleware(jwtSecret))
authed.GET("/me", h.GetMe)
authed.GET("/me/preferences", h.GetMyPreferences)
authed.PUT("/me/preferences", h.UpdateMyPreferences)
authed.GET("/me/assets", h.GetMyAssets)
authed.POST("/me/assets", h.AddMyAsset)
authed.DELETE("/me/assets/:symbol", h.RemoveMyAsset)
@ -81,6 +82,7 @@ func SetupRouter(h *handlers.Handler, jwtSecret string) *gin.Engine {
admin.PUT("/schedule", h.UpdateSchedule)
admin.GET("/users", h.ListUsers)
admin.POST("/users", h.CreateAdminUser)
admin.PUT("/users/:id", h.UpdateAdminUser)
admin.DELETE("/users/:id", h.DeleteAdminUser)