diff --git a/routes.go b/routes.go index 4467253..31b646f 100644 --- a/routes.go +++ b/routes.go @@ -35,10 +35,10 @@ func setupRoutes(router *mux.Router, routes []Route) { } if user := auth.GetUser(r.Context()); user != nil { - infos["username"] = user.Username + infos["loginId"] = user.Username infos["admin"] = user.HasRole(auth.RoleAdmin) } else { - infos["username"] = false + infos["loginId"] = false infos["admin"] = false } diff --git a/server.go b/server.go index cf6c745..f6e18cb 100644 --- a/server.go +++ b/server.go @@ -133,6 +133,7 @@ func setupJobRoute(i InfoType, r *http.Request) InfoType { func setupUserRoute(i InfoType, r *http.Request) InfoType { i["id"] = mux.Vars(r)["id"] + i["username"] = mux.Vars(r)["id"] return i } @@ -359,10 +360,10 @@ func main() { } if user := auth.GetUser(r.Context()); user != nil { - infos["username"] = user.Username + infos["loginId"] = user.Username infos["admin"] = user.HasRole(auth.RoleAdmin) } else { - infos["username"] = false + infos["loginId"] = false infos["admin"] = false } diff --git a/templates/base.tmpl b/templates/base.tmpl index 738a42f..b244a1f 100644 --- a/templates/base.tmpl +++ b/templates/base.tmpl @@ -69,13 +69,13 @@ {{end}} {{end}} - {{if .Infos.username }} + {{if .Infos.loginId }}