Exemplo n.º 1
0
 def post(self):
     jti = get_raw_jwt()["jti"]
     try:
         revoked_token = RevokedToken(jti=jti)
         revoked_token.add()
         response = {"msg": "Refresh token has been revoked"}
         return make_response(jsonify(response)), 200
     except Exception:
         response = {"msg": "Something went wrong!"}
         # Return a server error using the HTTP Error Code 500 (Internal
         # Server Error)
         return make_response(jsonify(response)), 500
Exemplo n.º 2
0
def token_is_blacklist(decypted_token):
    jti = decypted_token["jti"]
    return RevokedToken.is_jti_blacklisted(jti)