protect unlock api endpoint
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
5
main.go
5
main.go
@@ -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())
|
||||
|
Reference in New Issue
Block a user