We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In number of methods in the code current_user is fetched like this:
user_id = current_user["sub"] if current_user != None else None
If a user is logged this fails with error:
line 96, in get_current_user raise RuntimeError( RuntimeError: You must provide a@jwt.user_lookup_loadercallback to use this method
line 96, in get_current_user raise RuntimeError( RuntimeError: You must provide a
callback to use this method
My solution is to add the callback method in api/__init__.py right after JWTManager is initialized like this:
api/__init__.py
jwt = JWTManager(app) @jwt.user_lookup_loader def user_lookup_callback(_jwt_header, jwt_data): return jwt_data
I am using python==3.11, Flask==2.2.2, Flask-JWT-Extended==4.4.4 as per requirements.txt.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In number of methods in the code current_user is fetched like this:
user_id = current_user["sub"] if current_user != None else None
If a user is logged this fails with error:
line 96, in get_current_user raise RuntimeError( RuntimeError: You must provide a
@jwt.user_lookup_loadercallback to use this method
My solution is to add the callback method in
api/__init__.py
right after JWTManager is initialized like this:I am using python==3.11, Flask==2.2.2, Flask-JWT-Extended==4.4.4 as per requirements.txt.
The text was updated successfully, but these errors were encountered: