From 4e16de0975482d293136cc76022c32af3fccd295 Mon Sep 17 00:00:00 2001 From: Ruge Li Date: Thu, 18 Jan 2024 21:10:25 -0800 Subject: [PATCH] deserialize key --- cellpack/autopack/FirebaseHandler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cellpack/autopack/FirebaseHandler.py b/cellpack/autopack/FirebaseHandler.py index 0db5cb63..8246a002 100644 --- a/cellpack/autopack/FirebaseHandler.py +++ b/cellpack/autopack/FirebaseHandler.py @@ -98,15 +98,16 @@ def get_dev_creds(): @staticmethod def get_staging_creds(): - # use override=True to refresh .env in case software updates affect env variables loading - load_dotenv(dotenv_path="./.env", override=True) + # set override=True to refresh the .env file if softwares or tokens updated + load_dotenv(dotenv_path="./.env", override=False) FIREBASE_TOKEN = os.getenv("FIREBASE_TOKEN") + firebase_key = FIREBASE_TOKEN.replace("\\n", "\n") FIREBASE_EMAIL = os.getenv("FIREBASE_EMAIL") return { "type": "service_account", "project_id": "cell-pack-database", "client_email": FIREBASE_EMAIL, - "private_key": FIREBASE_TOKEN, + "private_key": firebase_key, "token_uri": "https://oauth2.googleapis.com/token", }