twitter #2
@ -22,7 +22,7 @@ def create_app():
|
|||||||
|
|
||||||
twitter_db.drop_all(app=app)
|
twitter_db.drop_all(app=app)
|
||||||
twitter_db.create_all(app=app)
|
twitter_db.create_all(app=app)
|
||||||
twitter_db.drop_all(app=app)
|
campaign_db.drop_all(app=app)
|
||||||
campaign_db.create_all(app=app)
|
campaign_db.create_all(app=app)
|
||||||
|
|
||||||
app.register_blueprint(twitter, url_prefix='/twitter')
|
app.register_blueprint(twitter, url_prefix='/twitter')
|
||||||
|
@ -8,6 +8,9 @@ AUDIENCE = os.environ.get('GOOGLE_CLOUD_PROJECT')
|
|||||||
def verify_token(headers):
|
def verify_token(headers):
|
||||||
id_token = headers['Authorization'].split(' ').pop()
|
id_token = headers['Authorization'].split(' ').pop()
|
||||||
|
|
||||||
|
try:
|
||||||
claims = google.oauth2.id_token.verify_firebase_token(id_token, HTTP_REQUEST, audience=AUDIENCE)
|
claims = google.oauth2.id_token.verify_firebase_token(id_token, HTTP_REQUEST, audience=AUDIENCE)
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
return claims
|
return claims
|
Loading…
Reference in New Issue
Block a user