Skip to content

Commit

Permalink
Added exclusive lock on token write for thread safety
Browse files Browse the repository at this point in the history
  • Loading branch information
kamermans committed Jun 20, 2018
1 parent aedc516 commit e8aeed5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Persistence/FileTokenPersistence.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct($filepath)

public function saveToken(TokenInterface $token)
{
file_put_contents($this->filepath, json_encode($token->serialize()));
file_put_contents($this->filepath, json_encode($token->serialize()), LOCK_EX);
}

public function restoreToken(TokenInterface $token)
Expand Down

0 comments on commit e8aeed5

Please sign in to comment.