We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5359d7c commit a740333Copy full SHA for a740333
src/Iam.php
@@ -403,11 +403,14 @@ protected function saveToken($token)
403
$this->expires_at = $this->convertExpiresAt($token->expiresAt ?? '');
404
$this->refresh_at = $token->refreshAt;
405
406
- file_put_contents($tokenFile, json_encode([
+ $randPath = $tokenFile."-tmp".bin2hex(random_bytes(10));
407
+ file_put_contents($randPath, json_encode([
408
'iamToken' => $this->iam_token,
409
'expiresAt' => $this->expires_at,
410
'refreshAt' => $this->refresh_at
411
]));
412
+ rename($randPath, $tokenFile);
413
+
414
}
415
416
/**
0 commit comments