Skip to content

[stable27] fix(Session): avoid race conditions on clustered setups - #46435

Merged
blizzz merged 2 commits into
stable27from
backport/46398/stable27
Jul 11, 2024
Merged

[stable27] fix(Session): avoid race conditions on clustered setups#46435
blizzz merged 2 commits into
stable27from
backport/46398/stable27

Conversation

@backportbot

@backportbotbackportbotBot commented Jul 11, 2024

Copy link
Copy Markdown

Backport of #46398

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Remove all the empty commits

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

$this->tokenProvider->invalidateToken($sessionId);
$this->tokenProvider->generateToken($sessionId, $uid, $loginName, $pwd, $name, IToken::TEMPORARY_TOKEN, $remember);
$this->atomic(function () use ($sessionId, $uid, $loginName, $pwd, $name, $remember) {
$this->tokenProvider->invalidateToken($sessionId);

Check failure

Code scanning / Psalm

UndefinedThisPropertyFetch

Instance property OC\User\Session::$tokenProvider is not defined
blizzz added 2 commits July 11, 2024 10:38
- re-stablishes old behaviour with cache to return null instead of throwing
an InvalidTokenException when the token is cached as non-existing
- token invalidation and re-generation are bundled in a DB transaction now
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
prefer to keep this check as PublicEmitter should be dropped sooner or
later
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz
blizzzforce-pushed the backport/46398/stable27 branch from fbb5339 to e39be84CompareJuly 11, 2024 08:38
@blizzz
blizzz marked this pull request as ready for review July 11, 2024 08:39
@blizzz
blizzz requested review from a team, Altahrim, sorbaugh and yemkareems and removed request for a teamJuly 11, 2024 08:39
@blizzz
blizzz merged commit 38a6c50 into stable27Jul 11, 2024
@blizzz
blizzz deleted the backport/46398/stable27 branch July 11, 2024 14:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@blizzz@Altahrim@github-advanced-security