简体   繁体   English

Angular:firebase托管的网站登录失败

[英]Angular: the website hosted on firebase fail to log in

I hosted a website on firebase, the login method worked well on localhost.我在 firebase 上托管了一个网站,登录方法在本地主机上运行良好。 However, on the hosted website, the login window just flashes for a sec and fails to login: https://angular-example-gg.web.app/ .但是,在托管网站上,登录名 window 只是闪烁了一秒钟,无法登录: https://angular-example-gg.web.app/

Here is my code:这是我的代码:

<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>

I am not sure if the reason for this problem is because of my code or my hosting process?我不确定这个问题的原因是因为我的代码还是我的托管过程?

Dear fellow your api Key of Google is not valid please check the error when you hit the API亲爱的朋友,你的 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"}}"

Thanks..谢谢..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM