Skip to content

Commit

Permalink
fix(fof/masquerade): Use the user ID instead of an actor that can be …
Browse files Browse the repository at this point in the history
…a moderator
  • Loading branch information
rafaucau committed Jun 16, 2023
1 parent b6be422 commit cca1fd2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Compatibility/FofMasquerade/Middleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use ACPL\FlarumCache\Abstract\PurgeMiddleware;
use Flarum\Http\RequestUtil;
use Flarum\User\User;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
Expand All @@ -17,7 +18,8 @@ protected function processPurge(
): ResponseInterface {
// Purge user profile cache when updating FriendsOfFlarum/masquerade fields
if ($this->currentRouteName === 'masquerade.api.configure.save') {
$user = RequestUtil::getActor($request);
$userID = $this->getRouteParams($request)['id'];
$user = User::find($userID);

return $this->addPurgeParamsToResponse(
$response,
Expand Down

0 comments on commit cca1fd2

Please sign in to comment.