How do you get access to the cache from an JWTAuthenticationMiddleware? #1337
-
In the docs I see it being accessed using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You don't need to go through so many indirections though, as Check out the |
Beta Was this translation helpful? Give feedback.
scope
is an attribute ofASGIConnection
, which is passed intoauthenticate_request
.So you could access the scope like this:
connection.scope
, and get the cache withconnection.scope["app"].cache
.You don't need to go through so many indirections though, as
ASGIConenction
directly exposesapp
andcache
properties, which means the easiest way to access it isconnection.cache
.Check out the
ASGIConnection
docs.