We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{"error": "invalid_token", "error_description": "The access token provided is expired, revoked, malformed, or invalid for other reasons."}
The text was updated successfully, but these errors were encountered:
customize error messages
@bp.after_request def after_handler(response): match response.status_code: case 200: # retunr 200 status_code return response case 500: # return 500 status_code return response case _: # handling other status_code data = loads(response.data) # check data key if "error" in data: # change status_code to 200 response.status_code = 200 # handling custom message match data["error"]: case "invalid_token": response.data = dumps({"code": 401, "msg": "invalid_token"}) case "invalid_request": response.data = dumps({"code": 401, "msg": "invalid_request"}) case "invalid_client": response.data = dumps({"code": 401, "msg": "invalid_client"}) case "missing_authorization": response.data = dumps({"code": 401, "msg": "missing_authorization"}) case _: response.data = dumps({"code": 500, "msg": "system error"}) return response
Sorry, something went wrong.
No branches or pull requests
{"error": "invalid_token", "error_description": "The access token provided is expired, revoked, malformed, or invalid for other reasons."}
The text was updated successfully, but these errors were encountered: