Skip to content

Commit

Permalink
Merge pull request #517 from sumesh-aot/jwt
Browse files Browse the repository at this point in the history
Handling Jose parse errors
  • Loading branch information
gil0109 authored Feb 21, 2021
2 parents facd447 + 00a502f commit 8e42b04
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/qsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from sqlalchemy.exc import SQLAlchemyError
from app.exceptions import AuthError
from flask_jwt_oidc.exceptions import AuthError as JwtAuthError
from jose.exceptions import JOSEError
from sqlalchemy import event
from sqlalchemy.engine import Engine

Expand Down Expand Up @@ -360,6 +361,12 @@ def handle_jwt_auth_error(error):
return error.error, error.status_code


@application.errorhandler(JOSEError)
@api.errorhandler(JOSEError)
def handle_jose_jwt_error(error):
return {}, 401


@event.listens_for(Engine, "before_cursor_execute")
def before_cursor_execute(conn, cursor, statement,
parameters, context, executemany):
Expand Down

0 comments on commit 8e42b04

Please sign in to comment.