Skip to content

Conversation

@julien-nc
Copy link
Member

@julien-nc julien-nc commented Aug 18, 2025

Store a lock in the php session.

closes #1175

…, store lock in the php session

Signed-off-by: Julien Veyssier <[email protected]>
@julien-nc julien-nc force-pushed the fix/1175/lock-token-refresh branch from 019e2c2 to 17c444d Compare August 25, 2025 12:04
Comment on lines +169 to +174
$sessionLocked = $this->session->get(self::REFRESH_LOCK_KEY);
if ($sessionLocked !== null) {
throw new TokenRefreshLockedException();
}
// acquire lock
$this->session->set(self::REFRESH_LOCK_KEY, 1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this also racy? The set operation would better be some kind of atomic check-and-set

Sign up for free to 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.

Race condition in TokenService causes logouts on token refresh

3 participants