added user informations cell
All checks were successful
Tests / Run Go Tests (push) Successful in 16s

This commit is contained in:
2025-10-04 19:37:57 +02:00
parent 566776910a
commit 0ffb910e37
5 changed files with 95 additions and 100 deletions

View File

@@ -3,6 +3,7 @@ package endpoints
import (
"arbeitszeitmessung/models"
"arbeitszeitmessung/templates"
"context"
"log"
"net/http"
)
@@ -38,5 +39,9 @@ func changePassword(w http.ResponseWriter, r *http.Request) {
}
func showUserPage(w http.ResponseWriter, r *http.Request, status int) {
templates.UserPage(status).Render(r.Context(), w)
var ctx context.Context
if user, err := models.GetUserFromSession(Session, r.Context()); err == nil {
ctx = context.WithValue(r.Context(), "user", user)
}
templates.UserPage(status).Render(ctx, w)
}