mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-04-16 13:48:36 +02:00
modify a clone request data when resolving the auth record response
This commit is contained in:
parent
39408f135b
commit
0b54d1736e
@ -71,13 +71,14 @@ func (api *recordAuthApi) authResponse(c echo.Context, authRecord *models.Record
|
|||||||
// expand record relations
|
// expand record relations
|
||||||
expands := strings.Split(c.QueryParam(expandQueryParam), ",")
|
expands := strings.Split(c.QueryParam(expandQueryParam), ",")
|
||||||
if len(expands) > 0 {
|
if len(expands) > 0 {
|
||||||
requestData := GetRequestData(e.HttpContext)
|
// create a copy of the cached request data and adjust it to the current auth record
|
||||||
|
requestData := *GetRequestData(e.HttpContext)
|
||||||
requestData.Admin = nil
|
requestData.Admin = nil
|
||||||
requestData.AuthRecord = e.Record
|
requestData.AuthRecord = e.Record
|
||||||
failed := api.app.Dao().ExpandRecord(
|
failed := api.app.Dao().ExpandRecord(
|
||||||
e.Record,
|
e.Record,
|
||||||
expands,
|
expands,
|
||||||
expandFetch(api.app.Dao(), requestData),
|
expandFetch(api.app.Dao(), &requestData),
|
||||||
)
|
)
|
||||||
if len(failed) > 0 && api.app.IsDebug() {
|
if len(failed) > 0 && api.app.IsDebug() {
|
||||||
log.Println("Failed to expand relations: ", failed)
|
log.Println("Failed to expand relations: ", failed)
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user