我在Angular 2中有一个使用Firebase Google Auth的简单网站:
app.routes.ts
...
export const APP_ROUTES: Routes = [
{ path: '', component: HomeComponent, canActivate: [AuthGuard] },
{ path: 'login', component: LoginComponent }
];
auth.service.ts
...
loginWithGoogle(): firebase.Promise<any> {
return this.af.auth.login({
provider: AuthProviders.Google,
method: AuthMethods.Popup
}).catch((error) => {
console.error("Google Auth: ", error);
});
}
login.component.ts
...
login() {
this.authService.loginWithGoogle().then((data) => {
this.router.navigate(['']);
}).catch((error) => {
this.error = error;
});
}
在我的本地主机上,一切都很好 . 但是一旦我部署到firebaseapp托管,(甚至从ng build dist文件夹运行localhost live-server),我就会在登录时遇到这个错误:
EXCEPTION:未捕获(承诺):错误:无法匹配任何路由 . 网址细分:'__/auth/iframe'
zone_symbol__error: Error: Cannot match any routes. URL Segment: ' / / auth / iframe'在y(https:// ...