As I understood, emberfire auth works via torii and includes the own torii-provider (torii-providers/firebase.js
).
When I try to sign in, it runs signInWithPopup
method from the firebase provider. It does not work when the application is running on a mobile device via cordova (location.protocol
is equal to "file:"
).
I've found a workaround:
I use the cordova plugin for authorization via google to get idToken.
I've overridden the provider to use
signInWithCredential
:export default ToriiFirebaseProvider.extend({ open(idToken) { const firebaseApp = get(this, 'firebaseApp'); const credentials = get(firebaseApp, 'firebase_.auth.GoogleAuthProvider.credential')(idToken); return firebaseApp.auth().signInWithCredential(credentials); } });
It works now, but I'm not sure that it's the right solution?