File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 55
66from flask_jwt_extended .config import config
77from flask_jwt_extended .exceptions import RevokedTokenError
8+ from flask_jwt_extended .utils import get_jti
89
910# TODO make simplekv an optional dependency if blacklist is disabled
1011
@@ -80,13 +81,24 @@ def unrevoke_token(jti):
8081 """
8182 Revoke a token
8283
83- :param jti: The jti of the token to revoke
84+ :param jti: The jti of the token to unrevoke
8485 """
8586 _update_token (jti , revoked = False )
8687
8788
8889@_verify_blacklist_enabled
89- def get_stored_token (jti ):
90+ def get_stored_token (jti = None , encoded_token = None ):
91+ """
92+ Get the stored token for the passed in jti or encoded_token
93+
94+ :param jti: The jti of the token
95+ :param encoded_token: The encoded JWT string
96+ :return: Python dictionary with the token information
97+ """
98+ if jti is None and encoded_token is not None :
99+ jti = get_jti (encoded_token )
100+ elif jti is None and encoded_token is None :
101+ raise ValueError ('Either jti or encoded_token is required' )
90102 return _get_token_from_store (jti )
91103
92104
You can’t perform that action at this time.
0 commit comments