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 authored and backportbot[bot] committed Jul 31, 2024
1 parent da3c81b commit 5f7a36f
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 @@ -50,7 +50,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 54 in lib/Service/UserScopeService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

RedundantCondition

lib/Service/UserScopeService.php:54: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 5f7a36f

Please sign in to comment.