joshua-hashimoto / django-channels-jwt-auth-middleware Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Is it possible to reject connection of who wants to connect in connect()
function with token in URL and even We don't check in the receive()
function for user validity?
Is there a way to return the ExpiredSignatureErrors
to the socket?
Currently the middleware is raising the following exception:
File ".../env/lib/python3.11/site-packages/django_channels_jwt_auth_middleware/auth.py", line 39, in get_payload
payload = jwt_decode(
^^^^^^^^^^^
File ".../env/lib/python3.11/site-packages/jwt/api_jwt.py", line 210, in decode
decoded = self.decode_complete(
^^^^^^^^^^^^^^^^^^^^^
File ".../env/lib/python3.11/site-packages/jwt/api_jwt.py", line 162, in decode_complete
self._validate_claims(
File ".../env/lib/python3.11/site-packages/jwt/api_jwt.py", line 248, in _validate_claims
self._validate_exp(payload, now, leeway)
File ".../env/lib/python3.11/site-packages/jwt/api_jwt.py", line 306, in _validate_exp
raise ExpiredSignatureError("Signature has expired")
jwt.exceptions.ExpiredSignatureError: Signature has expired
IMO the exception should be captured and returned to the socket so that the client can refresh their token and try again.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.