Skip to content

Commit 1c6aabb

Browse files
author
Cerlin
committed
Mechanism to regenerate new token if old one became invalid
1 parent 86e41ce commit 1c6aabb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Box/Auth/AppAuth.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ public function authenticate(JWTClaim $claim)
9696
*/
9797
public function getTokenInfo()
9898
{
99-
// TODO: Validate if token is expired and then send
99+
if (($this->token_info->issued_time + $this->token_info->expires_in) < time()) {
100+
$this->claim->exp = time() + 10;
101+
$this->authenticate($this->claim);
102+
}
100103
return $this->token_info;
101104
}
102105

0 commit comments

Comments
 (0)