fix: RegisterPublicRoute pour pages HTML modules + masquer installés dans store
- RouteEntry.Public bool : routes sans auth (pages HTML navigables par Swup) - RegisterPublicRoute() ajouté à Registry interface + coreRegistry - main.go : switch public/auth/admin pour les routes modules - modules.html : masque les modules déjà installés dans le store Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3c8a1a6b58
commit
365165c13b
4 changed files with 16 additions and 5 deletions
|
|
@ -201,9 +201,12 @@ func main() {
|
|||
// Routes enregistrées par les modules actifs
|
||||
for _, route := range loader.Registry().GetRoutes() {
|
||||
routeCopy := route // Capturer la variable pour la closure
|
||||
if routeCopy.RequireAdmin {
|
||||
switch {
|
||||
case routeCopy.Public:
|
||||
r.MethodFunc(routeCopy.Method, routeCopy.Path, routeCopy.Handler)
|
||||
case routeCopy.RequireAdmin:
|
||||
r.With(api.RequireAuth(jwtManager), api.RequireAdmin).MethodFunc(routeCopy.Method, routeCopy.Path, routeCopy.Handler)
|
||||
} else {
|
||||
default:
|
||||
r.With(api.RequireAuth(jwtManager)).MethodFunc(routeCopy.Method, routeCopy.Path, routeCopy.Handler)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue