diff --git a/pkg/app/data.go b/pkg/app/data.go index 5c75377d..c0574803 100644 --- a/pkg/app/data.go +++ b/pkg/app/data.go @@ -66,15 +66,14 @@ func (a *App) setUser(c echo.Context) error { func (a *App) getCurrentUser(c echo.Context) *database.User { d := c.Get("user_info") - if d == nil { - return database.AnonymousUser() - } u, ok := d.(*database.User) if !ok { - return database.AnonymousUser() + u = database.AnonymousUser() } + u.SetContext(c.Request().Context()) + return u }