get username from the proxy header

This commit is contained in:
fungal 2023-12-19 22:05:49 +01:00
parent 77d2e2caa5
commit 1ab0a78951

View file

@ -42,7 +42,8 @@ func handleForm(w http.ResponseWriter, r *http.Request) {
}
now := time.Now().UTC().Format(time.RFC3339)
entry := strings.Join([]string{now, "unknown", details.Label, details.Url}, ",")
username := r.Header.Get("X-Forwarded-Preferred-Username")
entry := strings.Join([]string{now, username, details.Label, details.Url}, ",")
insertEntry(entry)
tmpl.Execute(w, struct{ Success bool }{true})