-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initialise same app for firestore and auth #1821
base: main
Are you sure you want to change the base?
Conversation
@@ -58,7 +58,7 @@ class FirestoreAPIProvider extends APIProvider with LiveAPIProvider { | |||
} else { | |||
// Initialize the new Firebase app with the options | |||
FirebaseApp app = await Firebase.initializeApp( | |||
name: appId, | |||
name: 'customFirebase', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
firebase auth initialisation:
ensemble/modules/auth/lib/signin/auth_manager.dart
Lines 178 to 179 in 3b31f77
return await Firebase.initializeApp( | |
name: 'customFirebase', options: options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, my question was why hardcode the name of the app? is it supposed to match something somewhere else? where?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we just need to name firebase app, since we have ensemble firebase app initialised.
Only the firebase auth and firestore need to match the name of firebase app.
Either way we'll need to have single initialisation of firebase service to not worry about matching everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the reason I did it this way was to allow multiple apps to run in Ensemble Go and the Studio. That use case will fail if we hardcode the app name right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, we can keep firestore initialisation as it is and update the auth side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - on the auth side we can just use the appId as well and then the two will be the same right? I am not sure if that'll be an issue or not?
Ticket: #1812