How to retrieve a Facebook O-Auth session from Python Flask -
so i'm going through auth-o-matic flask tutorial. able work want of course apply session other pages. if user has logged in have session specific browser. tutorial recommended if wanted use flask-session save session in way.
result = authomatic.login( werkzeugadapter(request, response), provider_name, session=session, session_saver=lambda: app.save_session(session, response) )
when looking @ examples (runnable.com/uhf58hcco9rsaacs/using-sessions-in-flask-for-python) using flask sessions notice session bound more explicitly app.session
. makes sense can check session in if statement every time user requests route. imagine like,
@app.route('/content') def content(): if app.open_session(app): return render_template('content.html', session=app.open_session() ) return render_template('content.html')
this makes sense me i'm wondering if it's coming misunderstanding of sessions. if can explain small example me of explain why doesn't work appreciate it! i've posted full code on github gist (link below).
tldr: have facebook authentication auth-o-matic , can't access session variable apply other routes make sure user logged in when accessing critical sections. code examples , full code in links.
thank you!
Comments
Post a Comment