Skip to content

Commit

Permalink
Use FIREBASE_PROJECT_ID for Firestore database (#26)
Browse files Browse the repository at this point in the history
* Use FIREBASE_PROJECT_ID for Firestore database

* Use project keyword for AsyncClient
  • Loading branch information
dinvlad authored Jan 2, 2024
1 parent 18f54da commit 87c27ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def create_app() -> Quart:
app = cors(app, allow_origin=list(origins))

app.config.from_mapping(
SECRET_KEY=secrets.token_hex(16), DATABASE=firestore.AsyncClient()
SECRET_KEY=secrets.token_hex(16),
DATABASE=firestore.AsyncClient(
project=os.getenv("FIREBASE_PROJECT_ID", "broad-cho-priv1"),
),
)

app.register_blueprint(status.bp)
Expand Down
2 changes: 1 addition & 1 deletion src/web/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def create_custom_token() -> Response:
{
"customToken": custom_token.decode("utf-8"),
"firebaseApiKey": firebase_api_key,
"firebaseProjectId": os.getenv("FIREBASE_PROJECT_ID", "broad-cho-priv1"),
"firebaseProjectId": current_app.config["DATABASE"].project,
}
),
200,
Expand Down

0 comments on commit 87c27ef

Please sign in to comment.