使用AngularFire2 Auth live:错误无法匹配任何路由。网址细分:'__ / auth / iframe'

时间:2017-03-15 10:41:18

标签: angular firebase angular2-routing angular-cli angularfire2

我在Angular 2中有一个简单的网站,使用Firebase Google Auth:

app.routes.ts

procedure TForm1.Button1Click(Sender: TObject);
var C: TServerMethods1Client;
begin
  C := TServerMethods1Client.Create(SQLConnection1.DBXConnection);
  try
    ClientDataSet1.Data := C.GetDataSet;
  finally
    C.DisposeOf;
  end;
end;

auth.service.ts

...
export const APP_ROUTES: Routes = [
    { path: '', component: HomeComponent, canActivate: [AuthGuard] },
    { path: 'login', component: LoginComponent }
];

login.component.ts

...
loginWithGoogle(): firebase.Promise<any> {
    return this.af.auth.login({
        provider: AuthProviders.Google,
        method: AuthMethods.Popup
    }).catch((error) => {
        console.error("Google Auth: ", error);
    });
}

在我的本地主机上,一切都很棒。但是一旦我部署到firebaseapp托管,(甚至从ng build dist文件夹运行localhost live-server),我就会在登录时遇到这个错误:

EXCEPTION:Uncaught(承诺): 错误:无法匹配任何路由。网址细分:'__ / auth / iframe'

zone_symbol__error: 错误:无法匹配任何路由。 网址细分:' / auth / iframe'位于y(https:// ...

0 个答案:

没有答案