-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different TTL configurations for each guard #164
Comments
You can create a PR to help improve that. |
Hello @avidianity. How do you do it outside the config? When I try out the |
@xyl-san |
Yes. I passed my custom guard in the |
@xyl-san that's a common issue in vscode, I have that as well. Installing jwt-auth or other 3rd party auth packages does not modify What I do in my case is use a typed property or add it's correct type using phpdoc. Solution 1: use PHPOpenSourceSaver\JWTAuth\JWTGuard;
class AuthController extends Controller
{
protected JWTGuard $guard;
public function __construct()
{
$this->guard = auth('api');
}
} Solution 2: use PHPOpenSourceSaver\JWTAuth\JWTGuard;
class AuthController extends Controller
{
public function yourMethod()
{
/**
* @var JWTGuard
*/
$guard = auth('api');
}
} there's also a way to modify it's internal typings as well by using a method similar to |
Thanks! I did not know that. I thought I was the only one having this issue. |
Summary
I have the following guards defined which uses different models and it works really well for me, one problem that I have is I can't have them configured with their own set of TTLs. I can do it outside the config but it's hard to maintain.
I have defined my
auth.php
config like this:It would be nice if I could do the following:
The text was updated successfully, but these errors were encountered: