polymerfire icon indicating copy to clipboard operation
polymerfire copied to clipboard

[firebase-auth] Ability to set custom parameters into auth providers

Open fabito opened this issue 8 years ago • 1 comments

Hi,

I need to set a custom parameter in the GoogleAuthProvider. Something like this:

var provider = new firebase.auth.GoogleAuthProvider();
provider.setCustomParameters({
  prompt: 'select_account'
});

Which extension point could be implemented to support this ? A new attribute ?

fabito avatar Oct 05 '17 04:10 fabito

@fabito right now I am not aware of having a helper for that in firebase-auth but what you can do is this:

<firebase-auth id="auth" user="{{user}}"></firebase-auth>

// on scripts part
var auth = this.shadowRoot.querySelector('#auth')
var provider = new firebase.auth.GoogleAuthProvider();
provider.setCustomParameters({
  prompt: 'select_account'
});

auth.signInWithPopup(provider).then(result => {
  console.log(result.user)
})

tjmonsi avatar Oct 05 '17 08:10 tjmonsi