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.
2 parents 5359d7c + b48610f commit 3a8f11aCopy full SHA for 3a8f11a
CHANGELOG.md
@@ -1,3 +1,5 @@
1
+* updated saveToken function in Iam.php
2
+
3
## 1.5.4
4
5
* fixed jwt authentication
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