feat: Enhance admin user management system
- Add admin override capability to DELETE /api/auth/account endpoint - Move /api/auth/users to admin-only with complete user fields (first_name, last_name, role, theme) - Consolidate Bruno requests: remove duplicate List Users (Admin), merge Delete Account functionality - Update all documentation to reflect enhanced capabilities - Implement pgx 5 standards compliance with proper error handling BREAKING CHANGES: - /api/auth/users endpoint now requires admin role (was previously accessible) - DELETE /api/auth/account accepts optional user_id parameter for admin deletion
This commit is contained in:
+2
-2
@@ -70,10 +70,10 @@ func main() {
|
||||
protected := e.Group("/api", jwtMiddleware)
|
||||
protected.GET("/auth/profile", authHandler.GetProfile)
|
||||
protected.PUT("/auth/profile", authHandler.UpdateProfile)
|
||||
protected.GET("/auth/users", authHandler.ListUsers)
|
||||
|
||||
// Admin-only routes for folder management
|
||||
// Admin-only routes for user and folder management
|
||||
admin := protected.Group("/auth", handlers.AdminMiddleware)
|
||||
admin.GET("/users", authHandler.ListUsers)
|
||||
admin.POST("/ebook-folders", authHandler.AddEbookFolder)
|
||||
admin.GET("/ebook-folders", authHandler.GetEbookFolders)
|
||||
admin.DELETE("/ebook-folders", authHandler.DeleteEbookFolder)
|
||||
|
||||
Reference in New Issue
Block a user