[#2173] fixed request.auth.* initialization which caused the current authenticated user email to not being returned in the authRefresh() calls

This commit is contained in:
Gani Georgiev
2024-02-07 19:50:55 +02:00
parent 3b6fcf265a
commit bada2338f7
35 changed files with 97 additions and 82 deletions

View File

@@ -106,9 +106,10 @@ func NewRecordFieldResolver(
r.staticRequestInfo["data"] = r.requestInfo.Data
r.staticRequestInfo["auth"] = nil
if r.requestInfo.AuthRecord != nil {
r.requestInfo.AuthRecord.IgnoreEmailVisibility(true)
r.staticRequestInfo["auth"] = r.requestInfo.AuthRecord.PublicExport()
r.requestInfo.AuthRecord.IgnoreEmailVisibility(false)
authData := r.requestInfo.AuthRecord.PublicExport()
// always add the record email no matter of the emailVisibility field
authData[schema.FieldNameEmail] = r.requestInfo.AuthRecord.Email()
r.staticRequestInfo["auth"] = authData
}
}