Hello,
I've got a question. I am using Angular in frontend and Laravel in backend, both are using jwt for tokens and our server uses http2. If I call my application several requests are started at the same time, when I refresh the token on the first request, the following requests are causing errors, because token is already invalid. Any solutions, except turning black list off?
Is it okay or is it a bad idea to add 'remember me' functionality when using JWT instead of sessions?
I have a project using JWT and I've gotten it to work so far (expires every hour, can be refreshed up to 2 weeks). But right now I have a useless remember me checkbox on my login page.
I'm trying to decide whether I should remove it or make it functional.
I've been looking through the code and it seems refresh_ttl
isn't found in any of the token's claims.
The exp
claim only refers to the regular ttl
.
So I can't use the getJWTCustomClaims
method in the User model specified in the docs of the package.
jwt.verify(token, config.secret, function(err, decoded){})
Hi! I wanted to leave here a good boilerplate with Koa2 Typescript, jwt-auth, logging orm sql docker.... Very good Readme, hope it helps somebody!
Hi guys, hope you all are well.
I'm having a problem with my Laravel 8 API using the latest version of the Tymon\JWTAuth lib.
My Laravel Api has some protected routes, but I don't login to it to get the token. For that I log into an external API, get the generated token and send this token to my Laravel api. To validate the token I get from the external API, I set the JWT_SECRET key from the .env with the same key as the external API.
Does that solve the problem? Is it otherwise? Can anyone tell me where to go?
Below is my middleware to verify the token of each request when the route is protected.
`
public function handle(Request $request, Closure $next)
{
try {
$user = JWTAuth::parseToken()->authenticate();
} catch(Exception $err) {
if ($err instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) {
return response()->json(['status' => 'Token is Expired'], 401);
} else if ($err instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) {
return response()->json(['status' => 'Token is Invalid'], 403);
} else {
return response()->json(['status' => 'Authorization Token not found'], 404);
}
}
return $next($request);
}
`