Files
ProxmoxAAS-Dashboard/app/routes/settings.go
T
alu b32a391022
tronnet/workflows: Static Analysis -- Golang / static-go (push) Successful in 26s
use HTTPExecuteHTMLTemplate and HTTPExecuteHTMLFragmentTemplate
2026-10-23 21:53:12 +00:00

27 lines
549 B
Go

package routes
import (
"net/http"
paas "proxmoxaas-common-lib"
"proxmoxaas-dashboard/app/common"
)
func HandleGETSettings(w http.ResponseWriter, r *http.Request) {
auth, err := common.GetAuthFromRequest(r)
if err == nil {
_, err := GetUserBasic(auth)
if err != nil {
common.HandleNonFatalError(w, err)
return
}
paas.HTTPExecuteHTMLTemplate(w, common.TMPL, "html/settings.html", map[string]any{
"global": common.Global,
"page": "settings",
})
} else {
http.Redirect(w, r, "/login", http.StatusFound)
return
}
}