Skip to content

Commit

Permalink
TEMP UPDATE: for hide stacktrace. visit graphql-python/flask-graphql#49
Browse files Browse the repository at this point in the history
  • Loading branch information
rscarrera27 committed Jul 21, 2018
1 parent 266fd5a commit 377a5b2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions flask_graphql_auth/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ def jwt_required(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
token = kwargs.pop(current_app.config['JWT_TOKEN_ARGUMENT_NAME'])
verify_jwt_in_argument(token)
try:
verify_jwt_in_argument(token)
except Exception as e:
return GraphQLError(e)

return fn(*args, **kwargs)
return wrapper

Expand All @@ -103,6 +107,10 @@ def jwt_refresh_token_required(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
token = kwargs.pop(current_app.config['JWT_TOKEN_ARGUMENT_NAME'])
verify_refresh_jwt_in_argument(token)
try:
verify_refresh_jwt_in_argument(token)
except Exception as e:
return GraphQLError(e)

return fn(*args, **kwargs)
return wrapper

0 comments on commit 377a5b2

Please sign in to comment.