polymerfire icon indicating copy to clipboard operation
polymerfire copied to clipboard

Broken Firebase Authentication

Open RoseReatherford opened this issue 8 years ago • 6 comments

Description

I am using the latest version of Polymer. I am a new user to Polymer, but it appears like even the most basic of firebase-auth elements will completely break. Any direction or help would be great.

Steps to reproduce

  1. Setup a basic authentication template. Here the one I was using (nesting inside of the 'src' folder).

  2. Serve the database using polymer serve.

  3. Press the button

  4. You will get an error that reads: Uncaught TypeError: Cannot read property 'signInWithPopup' of undefined

The error occurs on line 184 of firebase-auth.html which reads return this._attemptProviderSignIn(this._normalizeProvider(provider), this.auth.signInWithPopup);. Specifically, the error is occuring on this.auth.signInWithPopup

Browsers Affected

  • [x] Chrome
  • [ ] Firefox
  • [ ] Safari 9
  • [ ] Safari 8
  • [ ] Safari 7
  • [ ] Edge
  • [ ] IE 11
  • [ ] IE 10

RoseReatherford avatar Aug 22 '17 21:08 RoseReatherford

<firebase-app
                name="app"
                apiKey="[key]"
                authDomain= "[domain]"
                databaseURL= "[url]"
                storageBucket= "[storage]"
                messagingSenderId= "[id]">

Did you put the right values on the apiKey, authDomain, etc...? or is this just the example that you are showing?

tjmonsi avatar Aug 23 '17 03:08 tjmonsi

@RoseReatherford firebase-auth is missing "app-name" attribute which should be "app" that you have defined in firebase-app otherwise firebase-auth will use "default" as app-name for firebase config or default is not defined.

khammami avatar Aug 23 '17 10:08 khammami

@tjmonsi I am just using that as an example. I had my actual values defined, yes.

@khammami I tried doing that and that still receives the same error. Just now, I also tried changing the firebase-app to a name equal to "default" out of curiosity and this resulted in the same error.

RoseReatherford avatar Aug 24 '17 13:08 RoseReatherford

@RoseReatherford just remove app from firebase-app & app-name from firebase-auth

you have malformed attributes on firebase-app (it looks like you have copied web setup from firebase console as is it). here the correct one

<firebase-app
                api-key="[key]"
                auth-domain= "[domain]"
                database-url= "[url]"
                storage-bucket= "[storage]"
                messaging-sender-id= "[id]">
</firebase-app>

https://www.webcomponents.org/element/firebase/polymerfire

khammami avatar Aug 30 '17 14:08 khammami

Lemme try it again this week but given my workload, I can't promise :(

tjmonsi avatar Sep 02 '17 10:09 tjmonsi

Got the same issue with only Chrome Canary Everything seam fine for IE, Edge, Firebase and Chrome.

Every now and then Chrome Canary behave weirdly, so maybe it's not 'Polymerfire' related.

JoelCode avatar Sep 17 '17 06:09 JoelCode