store only UID in session vars, not complete user

This commit is contained in:
2025-09-20 17:33:03 -06:00
parent d8648ace80
commit 5ea7c6d829
3 changed files with 7 additions and 9 deletions
+5 -1
View File
@@ -49,7 +49,11 @@ type amContext struct {
// CurrentUser returns the current user from the session.
func (c *amContext) CurrentUser() *database.User {
return c.session.Values["user"].(*database.User)
u, err := database.AmGetUser(c.session.Values["user_id"].(int32))
if err != nil {
log.Errorf("unable to retrieve current user")
}
return u
}
// RC returns the HTTP result code for the current operation.