Hi!
I’m trying to update content on a page with a route. I read in the docs that If want to only perform one action with admin privileges and not log out the current user I need to user $kirby->impersonate() with a callback. But I’m having issues passing variables to it.
$kirby = kirby();
$result = $kirby->impersonate('kirby', function () {
page('myPage')->update([
'myField' => $fieldData
]);
});
Here $fieldData is collecting user information and thats why I can not collect taht info after the impersonate.
Any help is really appreaciated, thanks!