def getin_facebook(): current_app.logger.info('getinfb') token = request.form.get('token', False) username = request.form['username'] fbid = request.form['fbid'] first_name = request.form['first_name'] last_name = request.form['last_name'] timezone = request.form['timezone'] email = request.form['email'] img = "http://graph.facebook.com/" + request.form['fbid'] + "/picture" device = request.form.get("origin", None) doc = User.create_facebook(username, fbid, email, first_name, last_name, timezone, img) user = User.login_facebook(fbid) Audit.login_facebook(username, device) return jsonify(user) if user else abort(401)
def do_login_facebook(): username = request.form['fbid'] user = User.login_facebook(username) origin = request.form.get("origin", None) Audit.login_facebook(username, origin) return jsonify(user) if user else abort(401)