From fcfcaa0628b1b6e38cf57f80eddc5e034b89c7a1 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sun, 28 May 2023 17:36:56 +0300 Subject: [PATCH] refresh the cached logged admin and auth record --- apis/record_helpers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apis/record_helpers.go b/apis/record_helpers.go index c86f4e12..20a9ebda 100644 --- a/apis/record_helpers.go +++ b/apis/record_helpers.go @@ -25,6 +25,9 @@ func RequestData(c echo.Context) *models.RequestData { // return cached to avoid copying the body multiple times if v := c.Get(ContextRequestDataKey); v != nil { if data, ok := v.(*models.RequestData); ok { + // refresh auth state + data.AuthRecord, _ = c.Get(ContextAuthRecordKey).(*models.Record) + data.Admin, _ = c.Get(ContextAdminKey).(*models.Admin) return data } }