Skip to content

Instantly share code, notes, and snippets.

@toughrogrammer
Created May 23, 2016 06:12
Show Gist options
  • Select an option

  • Save toughrogrammer/ab08f4384862cbd0bdaf6e5eb2b5f245 to your computer and use it in GitHub Desktop.

Select an option

Save toughrogrammer/ab08f4384862cbd0bdaf6e5eb2b5f245 to your computer and use it in GitHub Desktop.
@oauth_provider.invalid_response
def invalid_response(req):
if req.error_message == 'Bearer token is expired.':
raise ExpiredError
elif req.error_message == 'Bearer token scope not valid.':
raise NoPermissionError
else:
raise RequiredSignInError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment