-
Notifications
You must be signed in to change notification settings - Fork 145
There is any way to validate Token from database if failed return 403 through before => function(){} #170
Comments
@ShivPandey the |
Hello. I have something similar and I have not been able to query my database when I get an error decoding the token. I am using Doctrine, I have a service where I perform the query to close the session, but in the constructor of the service I have to pass the container that contains entitymanager. That is precisely the problem, I cannot pass the container from the error function in the jwtauthentication middleware... |
@LeonardoYoel What about the $container = $app->getContainer(); // for example
$app->add(new JwtAuthentication ([
'error' => function() use ($container){ $container->doStuff(); }
])); |
I'm trying to handle |
@LeonardoYoel $slim->add(function (
\Psr\Http\Message\ServerRequestInterface $request,
\Psr\Http\Server\RequestHandlerInterface $handler
) {
try {
return $handler->handle($request);
} catch (Throwable $e) {
// report
\Sentry\captureException($e);
// rethrow (propagate)
throw $e;
}
}); If you place this middleware on top of the This is getting seriously off-topic, though. |
Line tuupola#170 is redundant.
The text was updated successfully, but these errors were encountered: