I’m trying to use the firebase emulator so it doesn’t send out emails to my fake test email addresses (which might be real).
When I try to sign a new user up in my dev environment that uses the firebase emulator it is saying the email address is already taken, which it is in my real firebase project but I have no accounts in my emulator, so it should allow the registration.
I used the firebase cli.
It gave me these files:
.firebaserc:
{
"projects": {
"default": "vepo-dev",
"development": "vepo-dev-e5b8a"
},
"targets": {},
"etags": {},
"dataconnectEmulatorConfig": {}
}
firebase.json:
{
"hosting": {
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"emulators": {
"auth": {
"port": 9099,
"persist": true
},
"ui": {
"enabled": true
},
"hosting": {
"port": 5003
},
"singleProjectMode": true
}
}
This is my firebase initialisation in main_development.json:
// Firebase
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
name: Env.instance!.firebaseAppName,
options: DefaultFirebaseOptions.currentPlatform,
);
FirebaseAuth.instance.useAuthEmulator('localhost', 9099);
So the DefaultFirebaseOptions.currentPlatform
being used in the block of code above is still a real firebase project, and that is the one that is being used for firebase auth instead of being emulated. So why isn’t it using the emulator version that has no accounts and letting me sign up the new user?