Firebase: Local Development and testing in AngularFire

ぃ、小莉子 提交于 2019-12-10 19:48:08

问题


I am using Angularfire to make a website. I am trying to integrate oauth based sign in with google for user authentication but when I try to run index.html file and try to login following error is displayed

11:59:28.189 Error: There are no login transports available for the requested method.
Stack trace:
Mg@file:///G:/Project/root/js/firebase.js:142:1267
dh/<@file:///G:/Project/root/js/firebase.js:163:141
1 app.js:31:4

I searched on stackoverflow for this and got this answer , it says that I need to setup a server for this.
Then I looked at firebase docs and they said

For security reasons, if you're using a web-based OAuth flow (Facebook, Twitter, Github, or Google), only domains that you whitelist are allowed to initiate authentication for your app. This does not apply to Email & Password, Anonymous, or Custom authentication methods. All Firebase applications have localhost and 127.0.0.1 enabled by default for local development and testing.

The authentication works fine after I host it on firebase but deploying takes a lot of time and also sometimes even I don't have access to internet.
So please suggest me easiest manner so I can run my app on localhost.


回答1:


An easy way to locally run a Firebase (or any other) web site is to use the Firebase tools and then run

firebase serve

See this blog post introducing the local server.



来源:https://stackoverflow.com/questions/34671083/firebase-local-development-and-testing-in-angularfire

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!