<s> """<STR_LIT>""" <EOL> import logging <EOL> from authomatic . extras . flask import FlaskAuthomatic <EOL> from authomatic . providers import oauth2 <EOL> from flask import Flask , jsonify <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> logger . addHandler ( logging . StreamHandler ( ) ) <EOL> app = Flask ( __name__ ) <EOL> app . config [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> fa = FlaskAuthomatic ( <EOL> config = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : oauth2 . Facebook , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT:email>' ] , <EOL> } , <EOL> } , <EOL> secret = app . config [ '<STR_LIT>' ] , <EOL> debug = True , <EOL> ) <EOL> @ app . route ( '<STR_LIT:/>' ) <EOL> @ fa . login ( '<STR_LIT>' ) <EOL> def index ( ) : <EOL> if fa . result : <EOL> if fa . result . error : <EOL> return fa . result . error . message <EOL> elif fa . result . user : <EOL> if not ( fa . result . user . name and fa . result . user . id ) : <EOL> fa . result . user . update ( ) <EOL> return jsonify ( name = fa . result . user . name , id = fa . result . user . id ) <EOL> else : <EOL> return fa . response <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> app . run ( debug = True ) </s>
