1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-04-26 17:23:06 +02:00

refresh the cached logged admin and auth record

This commit is contained in:
Gani Georgiev 2023-05-28 17:36:56 +03:00
parent d5314b028b
commit fcfcaa0628

View File

@ -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
}
}