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:
parent
d5314b028b
commit
fcfcaa0628
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user