We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ceee4e5 commit 263b111Copy full SHA for 263b111
src/server/api/jwt_ops.py
@@ -34,6 +34,12 @@ def create_token(username, accesslevel):
34
return jsonify(access_token=new_token)
35
36
37
-def get_jwt_user():
38
- """ Read the JWT and return the associated username """
39
- return get_jwt_identity()
+def validate_decode_jwt():
+ """ If valid, return jwt fields as a dictionary, else None """
+ jwtdict = None
40
+ try:
41
+ jwtdict = verify_jwt_in_request()[1]
42
+ except:
43
+ pass # Wasn't valid - either expired or failed validation
44
+
45
+ return jwtdict
0 commit comments