twitter #2

Merged
s434708 merged 50 commits from twitter into master 2022-06-09 19:42:33 +02:00
2 changed files with 5 additions and 2 deletions
Showing only changes of commit 708e241ea1 - Show all commits

View File

@ -22,7 +22,7 @@ def create_app():
twitter_db.drop_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)
app.register_blueprint(twitter, url_prefix='/twitter')

View File

@ -8,6 +8,9 @@ AUDIENCE = os.environ.get('GOOGLE_CLOUD_PROJECT')
def verify_token(headers):
id_token = headers['Authorization'].split(' ').pop()
claims = google.oauth2.id_token.verify_firebase_token(id_token, HTTP_REQUEST, audience=AUDIENCE)
try:
claims = google.oauth2.id_token.verify_firebase_token(id_token, HTTP_REQUEST, audience=AUDIENCE)
except:
return None
return claims