我在firebase上托管了一个网站,登录方法在localhost上运行良好。但是,在托管网站上,登录窗口仅闪烁一秒钟而无法登录:https://angular-example-gg.web.app/。
这是我的代码:
<mat-toolbar color="primary"> #navbar
<mat-toolbar-row>
<span routerLink="/recommand">SPACE</span>
<span class="spacer"></span>
<div *ngIf="auth.afAuth.authState | async as user; else showLogin">
<button mat-raised-button color="accent" routerLink="/dashboard">Write a Post</button>
<button mat-button (click)="auth.logout()">Logout</button>
</div>
<ng-template #showLogin>
<button mat-button (click)="auth.login()">Login with Google</button>
</ng-template>
</mat-toolbar-row>
<div id="bg"> #body
<div *ngIf="auth.afAuth.authState | async as user; else showLogin">
...
<ng-template #showLogin>
<div class="animation">Here, build your own space ...</div>
<button mat-raised-button id="tin" (click)="auth.login()" color="primary">Try it now</button>
</ng-template>
</div>
我不确定导致此问题的原因是因为我的代码还是托管过程?
答案 0 :(得分:0)
亲爱的您的Google api密钥无效,请在点击API时检查错误
"{"error":{"code":400,"message":"API key not valid. Please pass a valid API key.","errors":[{"message":"API key not valid. Please pass a valid API key.","domain":"global","reason":"badRequest"}],"status":"INVALID_ARGUMENT"}}"
谢谢..