示例#1
0
 def post(self):
     jti = get_raw_jwt()['jti']
     try:
         revoked_token = models.RevokedTokenModel(jti=jti)
         revoked_token.add()
         return {'message': 'Refresh token has been revoked'}
     except:
         return {'message': 'Something went wrong'}, 500
示例#2
0
def revoke_access_token(jti):
    """Revoke given access token."""
    revoked_token = models.RevokedTokenModel(jti=jti)
    revoked_token.add()