Skip to content

Commit e8aeed5

Browse files
committed
Added exclusive lock on token write for thread safety
1 parent aedc516 commit e8aeed5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/Persistence/FileTokenPersistence.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct($filepath)
1818

1919
public function saveToken(TokenInterface $token)
2020
{
21-
file_put_contents($this->filepath, json_encode($token->serialize()));
21+
file_put_contents($this->filepath, json_encode($token->serialize()), LOCK_EX);
2222
}
2323

2424
public function restoreToken(TokenInterface $token)

0 commit comments

Comments
 (0)