我相信 auth 模拟器是在 2020 年 10 月底发布的。验证模拟器功能请求 https://github.com/firebase/firebase-tools/issues/1677我正在尝试配置我的本地服务的角度应用程序以通过让 Angular/fire/auth 调用 localhost:9099 来使用 auth 模拟器。这可能吗?或者 Angular/Fire 团队目前正在研究这个问题吗?
我在环境中的 firebase 配置参数是:
firebase: {
host: 'localhost:5000',
ssl: false,
apiKey: '<redacted>',
authDomain: 'localhost:9099',
databaseURL: '',
projectId: '<redacted>',
storageBucket: '',
messagingSenderId: ''
}
我将 auth 模拟器端口 localhost:9099 放置在 authDomain 中,但这并没有解决问题。
我将 firebase 对象传递给 app.module.ts 文件 AngularFireModule.initializeApp(environment.firebase); 的导入部分中的 AngularFire
为了使用函数模拟器,我从 angular/fire/functions 包导入 ORIGIN 并启动并运行它。doc here https://github.com/angular/angularfire/blob/master/docs/functions/functions.md#cloud-functions-emulator。我还看到了用于将 Firesore 指向模拟器的设置导入。我在其中找不到任何内容docs https://github.com/angular/angularfire/blob/master/docs/auth/getting-started.md#5-getting-started-with-firebase-authentication关于如何将 auth 调用指向 auth 模拟器。
虽然我认为这不是最好的地方,但这在我的服务构造函数中对我有用:
constructor(private _angularFireAuth: AngularFireAuth) {
this._angularFireAuth.useEmulator('http://localhost:9099');
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)