I have a Polymer application in which I want to use Firebase auth. I have created a custom element with a <paper-dialog>
with email and password form.
If I include <firebase-app>
and <firebase-auth>
elements in the custom element, I am able to authenticate the user. So far, so good.
The problem arises when I want to sign the user out from the application, with a button/function in the root element. I need to get hold of the <firebase-auth>
element in order to call its signOut
method. I find the <firebase-auth>
element with $.id
or $$('#id')
but it returns null.
If I move the <firebase-auth>
and <firebase-app>
elements into the root element, then I have the same problem trying to access them from my custom sign-in element.
If I add just the <firebase-auth>
element to both places, I get 'No app configured for auth'
and if I add the <firebase-app>
element to both as well, I get 'Default app already defined'
.
How can I make this work?