Open Mahmoudz opened 7 years ago
Hi @Mahmoudz
The version of the api I am using doesn't have JWTAuth::decode in it, so my information may not apply. What version are you using?
Not sure if this helps, but
good luck
@Mando-Chris I'm using version 0.5.10.
JWTAuth::refresh
does take token as input and it's optional.
public function refresh($token = false)
{
$this->requireToken($token);
return $this->manager->refresh($this->token)->get();
}
All it's doing after getting the token is this:
public function refresh(Token $token)
{
$payload = $this->setRefreshFlow()->decode($token);
if ($this->blacklistEnabled) {
// invalidate old token
$this->blacklist->add($payload);
}
// return the new token
return $this->encode(
$this->payloadFactory->make([
'sub' => $payload['sub'],
'iat' => $payload['iat'],
])
);
}
@Mahmoudz Just realized we are using the develop
branch.
So my points are not relevant to you, sorry about that.
@Mando-Chris thanks anyway man :)
Do you try to refresh after the TTL, i.e. before exp is in the past?
@Mahmoudz I have the same problem, may I ask you?
In case this problem occurs within unit tests, when performing two requests in the same test:
try to run $this->refreshApplication()
, to clear the Request object that was stored by JWT from the first request
I'm using the Dingo API package with this JWT package.
Here's my straight forward code from the controller:
Here's the result of that code:
When disabling the blacklisting feature
'blacklist_enabled' => false
The new Token returned is the exact old Token with the same expiry date!!
WHY!