def fq_callback(): fq_logged_in = squarewheel.fq_logged_in() if not fq_logged_in: code = request.args.get('code', '') # Log in the user and set the session_key for the user session['session_key'] = squarewheel.user_login(code) # Get name and icon for the user to show it fq_firstname, fq_icon = squarewheel.get_fq_user() return render_template('start.html', fq_firstname=fq_firstname, fq_icon=fq_icon) else: return "Already logged in"
def startpage(): # Check whether user wants to disconnect disconnect = request.args.get('disconnect', '', type=bool) if disconnect: squarewheel.user_disconnect() # Is the user is logged in transfer the username/icon if squarewheel.fq_logged_in(): fq_firstname, fq_icon = squarewheel.get_fq_user() else: fq_firstname = False fq_icon = False return render_template('start.html', fq_oauth_url = fq.oauth_url(), fq_icon=fq_icon, fq_firstname=fq_firstname)