-
-
Notifications
You must be signed in to change notification settings - Fork 247
Closed
Description
After updating from 3.15 to 3.16 or greater, an expired token will throw the following error:
Traceback (most recent call last):
File "/Users/user/path/to/venv/lib/python3.7/site-packages/flask/app.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/user/path/to/venv/lib/python3.7/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/Users/user/path/to/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/Users/user/path/to/venv/lib/python3.7/site-packages/flask/app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Users/user/path/to/venv/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/Users/user/path/to/venv/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/Users/user/path/to/venv/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/user/path/to/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/Users/user/path/to/venv/lib/python3.7/site-packages/flask/app.py", line 1719, in handle_user_exception
return handler(e)
File "/Users/user/path/to/venv/lib/python3.7/site-packages/flask_jwt_extended/jwt_manager.py", line 99, in handle_expired_error
token = ctx_stack.top.expired_jwt
AttributeError: 'AppContext' object has no attribute 'expired_jwt'
@app.errorhandler(ExpiredSignatureError)
def handle_expired_error(e):
try:
token = ctx_stack.top.expired_jwt #<--- explodes here
return self._expired_token_callback(token)
except TypeError:
msg = (
"jwt.expired_token_loader callback now takes the expired token "
"as an additional paramter. Example: expired_callback(token)"
)
warn(msg, DeprecationWarning)
return self._expired_token_callback()I do not have a custom expired_token_loader so I'm using the default one (default_expired_token_callback)
motey
Metadata
Metadata
Assignees
Labels
No labels