feat(config): add box owner policy settings
Adds configuration options and environment variables to manage box owner policies, including settings for refresh counts and expiry.
This commit is contained in:
@@ -1,18 +1,28 @@
|
||||
package server
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (app *App) registerAdminRoutes(router *gin.Engine) {
|
||||
admin := router.Group("/admin")
|
||||
admin.Use(noStoreAdminHeaders)
|
||||
admin.GET("/login", app.handleAdminLogin)
|
||||
admin.GET("/login", func(ctx *gin.Context) {
|
||||
ctx.Redirect(http.StatusSeeOther, "/account/login")
|
||||
})
|
||||
admin.POST("/login", app.handleAdminLoginPost)
|
||||
admin.GET("", func(ctx *gin.Context) {
|
||||
ctx.Redirect(http.StatusSeeOther, "/account")
|
||||
})
|
||||
admin.GET("/", func(ctx *gin.Context) {
|
||||
ctx.Redirect(http.StatusSeeOther, "/account")
|
||||
})
|
||||
|
||||
protected := admin.Group("")
|
||||
protected.Use(app.requireAdminSession)
|
||||
protected.POST("/logout", app.handleAdminLogout)
|
||||
protected.GET("", app.handleAdminDashboard)
|
||||
protected.GET("/", app.handleAdminDashboard)
|
||||
protected.GET("/boxes", app.handleAdminBoxes)
|
||||
protected.GET("/users", app.handleAdminUsers)
|
||||
protected.POST("/users", app.handleAdminUsersPost)
|
||||
|
||||
Reference in New Issue
Block a user