Skip to content

Commit

Permalink
chore: Switch to new API to set volatile user to prevent persisting i…
Browse files Browse the repository at this point in the history
…t in any case

Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliushaertl committed Aug 1, 2024
1 parent 53cba73 commit b531f5d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Service/UserScopeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ public function setUserScope(string $uid = null): void {
if ($user === null) {
throw new InvalidArgumentException('No user found for the uid ' . $uid);
}
$this->userSession->setUser($user);

/** @psalm-suppress RedundantCondition */
if (method_exists($this->userSession, 'setVolatileActiveUser')) {
$this->userSession->setVolatileActiveUser($user);
} else {
$this->userSession->setUser($user);
}
}

/**
Expand Down

0 comments on commit b531f5d

Please sign in to comment.