question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create user Email/Password Auth method

See original GitHub issue

Hello every one, I’m trying to create a user management area in my app, but something is wrong. I’m using the basic method in in the firebase documentation firebase.auth().createUserWithEmailAndPassword(email, password) but time to execute the action an error displays

firebase.js:50 Uncaught Error: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp()

I was searching in the guides and the torii provider for the implementation but nothing shows related with the user admin.

I try to find the auth using this.get(‘auth’) as the session object but return undefined. Here is my code.

addUser () {
      var that = this,
          ctrl = that.get('controller');
     //Here is where throw the error
    //Even I try to use that.get('auth')
      firebase.auth()
        .createUserWithEmailAndPassword(ctrl.email, ctrl.password)
        .catch(function(error){
          Ember.set(that.currentModel, 'error', true);
          Ember.set(that.currentModel, 'errorMessage', error.message);
        });
    }

Thank you for the help!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
jamesdanielscommented, Dec 14, 2016

We should cover this in our docs, we only really mention social sign in

4reactions
grimaldodevcommented, Dec 14, 2016

I found the issue, in the future reference you can add an example hoy to inject the service to work with the object firebase, here the solution:

firebaseApp : Ember.inject.service(), //Here need to inject the service, use the convention that use when you 
  actions:{
    addUser () {
      var that = this,
          ctrl = that.get('controller');
      that.get('firebaseApp').auth()
        .createUserWithEmailAndPassword(ctrl.email, ctrl.password)
        .catch(function(error){
          Ember.set(that.currentModel, 'error', true);
          Ember.set(that.currentModel, 'errorMessage', error.message);
        });
    }

Sorry for bother and hope this will help others

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authenticate with Firebase using Password-Based Accounts ...
In the Firebase console, open the Auth section. On the Sign in method tab, enable the Email/password sign-in method and click Save. Create...
Read more >
Firebase For Web: Authentication - Auth with Email ... - Medium
Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate ... //Create User with Email and Password
Read more >
Email and Password Authentication - A Complete Guide to ...
Email /password authentication is probably the most popular method of authentication used today. It allows users to register and sign in to our...
Read more >
Passwordless Authentication with Email - Auth0
Navigate to Auth0 Dashboard > Authentication > Passwordless, and enable the Email switch. Select your Email Syntax, and enter your email's From, Subject,...
Read more >
Set up an email address as your verification method
Password reset authentication only. You'll need to choose a different method for two-factor verification. Set up your email address from the Security info...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found