protect unlock api endpoint
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-03 17:18:23 +11:00
parent 85bea202f0
commit f7168d465a
4 changed files with 19 additions and 5 deletions

View File

@@ -242,7 +242,7 @@ func main() {
// Register our routes
public := router.Group("/api")
public.POST("/login", controllers.Login)
public.POST("/unlock", controllers.Unlock)
//public.POST("/unlock", controllers.Unlock)
// API calls that only an administrator can make
adminOnly := router.Group("/api/admin")
@@ -252,6 +252,9 @@ func main() {
adminOnly.GET("/roles", controllers.GetRoles)
adminOnly.GET("/users", controllers.GetUsers)
// TODO Make unlock an admin only function
adminOnly.POST("/unlock", controllers.Unlock)
// Get secrets
protected := router.Group("/api/secret")
protected.Use(middlewares.JwtAuthMiddleware())