<s> from flask import g , Blueprint , request <EOL> from flask . ext . login import login_required , login_user <EOL> from social . actions import do_auth , do_complete , do_disconnect <EOL> from social . apps . flask_app . utils import psa <EOL> social_auth = Blueprint ( '<STR_LIT>' , __name__ ) <EOL> @ social_auth . route ( '<STR_LIT>' , methods = ( '<STR_LIT:GET>' , '<STR_LIT:POST>' ) ) <EOL> @ psa ( '<STR_LIT>' ) <EOL> def auth ( backend ) : <EOL> return do_auth ( g . backend ) <EOL> @ social_auth . route ( '<STR_LIT>' , methods = ( '<STR_LIT:GET>' , '<STR_LIT:POST>' ) ) <EOL> @ psa ( '<STR_LIT>' ) <EOL> def complete ( backend , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return do_complete ( g . backend , login = do_login , user = g . user , <EOL> * args , ** kwargs ) <EOL> @ social_auth . route ( '<STR_LIT>' , methods = ( '<STR_LIT:POST>' , ) ) <EOL> @ social_auth . route ( '<STR_LIT>' , <EOL> methods = ( '<STR_LIT:POST>' , ) ) <EOL> @ social_auth . route ( '<STR_LIT>' , <EOL> methods = ( '<STR_LIT:POST>' , ) ) <EOL> @ login_required <EOL> @ psa ( ) <EOL> def disconnect ( backend , association_id = None ) : <EOL> """<STR_LIT>""" <EOL> return do_disconnect ( g . backend , g . user , association_id ) <EOL> def do_login ( backend , user , social_user ) : <EOL> name = backend . strategy . setting ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> remember = backend . strategy . session_get ( name ) or request . cookies . get ( name ) or request . args . get ( name ) or request . form . get ( name ) or False <EOL> return login_user ( user , remember = remember ) </s>
