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 9fc12f6 commit 0009633Copy full SHA for 0009633
examples/blacklist.py
@@ -56,13 +56,19 @@ def refresh():
56
return jsonify(ret), 200
57
58
59
-# Endpoint for revoking a token when logging out
+# Endpoint for revoking an access token when logging out.
60
+# Please make sure JWT_BLACKLIST_TOKEN_CHECKS is set to 'all'
61
@app.route('/logout', methods=['POST'])
62
@jwt_required
63
def logout():
64
jwt = get_raw_jwt()
65
jti = jwt['jti']
- revoke_token(jti)
66
+ try:
67
+ revoke_token(jti)
68
+ except KeyError:
69
+ return jsonify({
70
+ 'msg': 'Requires access tokens to be blacklisted'
71
+ }), 500
72
return jsonify({"msg": "Successfully logged out"}), 200
73
74
0 commit comments