Closed chris-lee-lb closed 1 year ago
Or maybe we should add blacklist checks at class PHPOpenSourceSaver\JWTAuth\Validators\TokenValidator
.
I didn't understand your issue, please edit your post and provide the details in a deep explanation. Thanks.
@Messhias Sorry, my fault. Looks like I should use Auth::setToken($token)->logout();
to do proper logout, which not Auth::setToken($token)->invalidate();
Because invalidate()
will not clear up user instance inside JWTGuard
, so the following call Auth::setToken($token)->check()
will still be true.
PS : my use case is in one phpunit test case.
Subject of the issue
Describe your issue here.
Your environment:
Steps to reproduce
Just Call
Auth::setToken($token)->check()
Expected behaviour
Invalidated token Should not be passed.
Actual behaviour
Invalidated token Should has been passed.
Some Research
Looks like when we called class
PHPOpenSourceSaver\JWTAuth
s functioncheck()
, we actually called traitIlluminate\Auth\GuardHelpers
s functioncheck()
, which is not include the blacklist checks.