def change_header(uri, headers, body): oauth_token = current_user.get('services')['fitbit']['oauth_token_secret'] auth = headers.get('Authorization') if auth: print auth auth = auth + ', oauth_token="%s"' %oauth_token headers['Authorization'] = auth print uri print headers print body return uri, headers, body
def get_token(self, token=None): if self.blueprint.api.oauth_type == 'oauth2': return current_user.get('services')[self.blueprint.name]['access_token'] return current_user.get('services')[self.blueprint.name]['oauth_token']
def dispatch_request(self): if self.blueprint.name in current_user.get('services'): print('going here') flash('Already signed in to %s' % self.blueprint.name.capitalize()) return redirect(url_for('frontend.index')) return self.blueprint.oauth.authorize(callback=url_for('.authorized', _external=True))
def user(): if bp.name in current_user.get('services'): data = {'user_id': current_user.get('services')[bp.name]['user_id']} resp = bp.oauth.get('users/show.json', data=data) return jsonify(resp.data) return redirect(url_for('.login'))
def user(): if bp.name in current_user.get('services'): resp = bp.oauth.get('me') return jsonify(resp.data) return redirect(url_for('.login'))
def user(): if bp.name in current_user.get("services"): resp = bp.oauth.get("user") return jsonify(resp.data) return redirect(url_for(".login"))