You've already forked pocketbase
mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-07-04 05:10:36 +02:00
refresh the cached logged admin and auth record
This commit is contained in:
@ -25,6 +25,9 @@ func RequestData(c echo.Context) *models.RequestData {
|
|||||||
// return cached to avoid copying the body multiple times
|
// return cached to avoid copying the body multiple times
|
||||||
if v := c.Get(ContextRequestDataKey); v != nil {
|
if v := c.Get(ContextRequestDataKey); v != nil {
|
||||||
if data, ok := v.(*models.RequestData); ok {
|
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
|
return data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user