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
juliusknorr committed Jul 25, 2024
1 parent 0980182 commit cf3c883
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Service/UserScopeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ public function setUserScope(?string $uid = null): void {
if ($user === null) {
throw new InvalidArgumentException('No user found for the uid ' . $uid);
}
$this->userSession->setUser($user);

if (method_exists($this->userSession, 'setVolatileActiveUser')) {

Check failure on line 37 in lib/Service/UserScopeService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

RedundantCondition

lib/Service/UserScopeService.php:37:7: RedundantCondition: Type OCP\IUserSession for $this->userSession is always method-exists-setVolatileActiveUser (see https://psalm.dev/122)
$this->userSession->setVolatileActiveUser($user);
} else {
$this->userSession->setUser($user);
}
}

/**
Expand Down

0 comments on commit cf3c883

Please sign in to comment.