diff options
Diffstat (limited to 'handlers/admin.go')
| -rw-r--r-- | handlers/admin.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/handlers/admin.go b/handlers/admin.go index 8f302c0..5614e0e 100644 --- a/handlers/admin.go +++ b/handlers/admin.go @@ -6,12 +6,15 @@ import ( "auth-proxy/models" "auth-proxy/types" "auth-proxy/worker" + "auth-proxy/utils" "encoding/json" "fmt" "net/http" "strconv" "sync" "time" + + "github.com/gorilla/csrf" ) var workerPool *types.WorkerPool @@ -32,8 +35,9 @@ func AdminPageHandler(w http.ResponseWriter, r *http.Request) { } data := map[string]interface{}{ - "Paths": config.Paths, - "Users": users, + "Paths": config.Paths, + "Users": users, + "CSRFToken": csrf.Token(r), } if err := templates.ExecuteTemplate(w, "admin.html", data); err != nil { logging.AppLog.Error("Failed to execute admin template", "error", err) |
