From 588f8c7c707cc0fc3fadf031dc9485591d396872 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 22 Mar 2021 22:51:37 +0100 Subject: [PATCH] add csrf --- assets/tpl/admin_create_clients.html | 1 + assets/tpl/admin_edit_client.html | 1 + assets/tpl/admin_edit_interface.html | 1 + assets/tpl/admin_edit_user.html | 3 ++- assets/tpl/login.html | 1 + go.mod | 3 +-- internal/server/configuration.go | 2 ++ internal/server/handlers_auth.go | 3 +++ internal/server/handlers_common.go | 9 +++------ internal/server/handlers_interface.go | 5 +++-- internal/server/handlers_peer.go | 4 ++++ internal/server/handlers_user.go | 3 +++ internal/server/server.go | 10 +++++++++- internal/server/server_helper.go | 3 +-- 14 files changed, 35 insertions(+), 14 deletions(-) diff --git a/assets/tpl/admin_create_clients.html b/assets/tpl/admin_create_clients.html index ea233ce..e2a3b06 100644 --- a/assets/tpl/admin_create_clients.html +++ b/assets/tpl/admin_create_clients.html @@ -20,6 +20,7 @@

Enter valid LDAP user email addresses to quickly create new accounts.

{{template "prt_flashes.html" .}}
+
diff --git a/assets/tpl/admin_edit_client.html b/assets/tpl/admin_edit_client.html index f42338c..4a429aa 100644 --- a/assets/tpl/admin_edit_client.html +++ b/assets/tpl/admin_edit_client.html @@ -22,6 +22,7 @@ {{template "prt_flashes.html" .}} + {{if .EditableKeys}}
diff --git a/assets/tpl/admin_edit_interface.html b/assets/tpl/admin_edit_interface.html index dd6e391..ca6add4 100644 --- a/assets/tpl/admin_edit_interface.html +++ b/assets/tpl/admin_edit_interface.html @@ -17,6 +17,7 @@ {{template "prt_flashes.html" .}} +

Server's interface configuration

{{if .EditableKeys}} diff --git a/assets/tpl/admin_edit_user.html b/assets/tpl/admin_edit_user.html index 166e98c..e42de7a 100644 --- a/assets/tpl/admin_edit_user.html +++ b/assets/tpl/admin_edit_user.html @@ -14,7 +14,7 @@ {{template "prt_nav.html" .}}
{{if eq .User.CreatedAt .Epoch}} -

Create a new user