Issue with the auth module on 3.0.0-rc.3
thaume opened this issue · comments
Hello there,
First, thanks for working on the next version of this ember addon, I cannot wait to switch to Firestore :)
I am having a small issue with the auth module though :
Version info
DEBUG: -------------------------------
index.js:146 DEBUG: Ember : 3.6.1
index.js:146 DEBUG: Ember Data : 3.6.0
index.js:146 DEBUG: jQuery : 3.4.1
index.js:146 DEBUG: Ember Simple Auth : 1.8.2
index.js:146 DEBUG: EmberFire : 3.0.0-rc.3
index.js:146 DEBUG: Firebase : 6.1.1
index.js:146 DEBUG: -------------------------------
Test case
Try to login with a Google account
Steps to reproduce
Side note : I have activated the google auth provider in the backend of firebase
ember new emberfire-auth
ember install emberfire@next (v3.0.0-rc.3 as of now)
=> first error
The "ember generate <entity-name>" command requires an entity name to be specified. For more details, use `ember help".
ember g firestore-adapter application
ember install ember-simple-auth
ember generate firebase-session-store session-store
create application.hbs template and its route as in the guides + add firebase config
(https://github.com/firebase/emberfire/blob/master/docs/guide/authentication.md#ember-simple-auth)
click on "sign in with Google"
Uncaught (in promise) TypeError: Cannot read property 'GoogleAuthProvider' of undefined
Expected behavior
The firebase object should contain the auth object which should contain GoogleAuthProvider.
Actual behavior
auth is undefined.
Hmmm, perhaps this is because the auth requirement is now lazy, what if you switch the order of those lines?
const auth = await this.get('firebaseApp').auth();
const provider = new firebase.auth.GoogleAuthProvider();
return auth.signInWithPopup(provider);
I do some more testing shortly.
I just did the whole installation from scratch today (including new ember-cli and all) and everything seems to work.
Thanks !