diff options
Diffstat (limited to 'oauth2client/contrib/flask_util.py')
-rw-r--r-- | oauth2client/contrib/flask_util.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/oauth2client/contrib/flask_util.py b/oauth2client/contrib/flask_util.py index fabd613..47c3df1 100644 --- a/oauth2client/contrib/flask_util.py +++ b/oauth2client/contrib/flask_util.py @@ -176,18 +176,19 @@ try: from flask import request from flask import session from flask import url_for - import markupsafe except ImportError: # pragma: NO COVER raise ImportError('The flask utilities require flask 0.9 or newer.') +import httplib2 import six.moves.http_client as httplib from oauth2client import client from oauth2client import clientsecrets -from oauth2client import transport from oauth2client.contrib import dictionary_storage +__author__ = 'jonwayne@google.com (Jon Wayne Parrott)' + _DEFAULT_SCOPES = ('email',) _CREDENTIALS_KEY = 'google_oauth2_credentials' _FLOW_KEY = 'google_oauth2_flow_{0}' @@ -389,7 +390,6 @@ class UserOAuth2(object): if 'error' in request.args: reason = request.args.get( 'error_description', request.args.get('error', '')) - reason = markupsafe.escape(reason) return ('Authorization failed: {0}'.format(reason), httplib.BAD_REQUEST) @@ -553,5 +553,4 @@ class UserOAuth2(object): """ if not self.credentials: raise ValueError('No credentials available.') - return self.credentials.authorize( - transport.get_http_object(*args, **kwargs)) + return self.credentials.authorize(httplib2.Http(*args, **kwargs)) |