3

There is a problem in starting..

I initialized my firebase app. But auth() is not working

var auth = firebase.auth();
console.log(auth.createUserWithEmailAndPassword)

createUserWithEmailAndPassword returns undefined.

It also gives function error

var email = "mail@mail.com"
var password = 123

var auth = firebase.auth();
auth.createUserWithEmailAndPassword(email, password).then(function(result) {
    console.log(result)
}).catch(function(error) {
    console.log(error)
});

The error:

TypeError: auth.createUserWithEmailAndPassword is not a function

What is the problem?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Ozer
  • 113
  • 1
  • 9
  • are you initializing your app with `firebase.initializeApp(config);`? – adolfosrs Jun 24 '16 at 14:00
  • Yes, I use initializeApp. firebase.database is working, but firebase.auth isn't working – Ozer Jun 24 '16 at 14:02
  • What is your version in package.json? Firebase had major change few weeks ago. Maybe you need to update to new 3.x version or go back to 2.x – libik Jun 24 '16 at 14:16
  • @libik I am using version 3.0.5 – Ozer Jun 24 '16 at 14:17
  • 2
    *firebaser here* There is no functionality to create users in the 3.0 version of the Firebase SDK for Node.js. We're working on it. See http://stackoverflow.com/questions/37504466/firebase-auth-createuserwithemailandpassword-undefined-is-not-a-function?lq=1 – Frank van Puffelen Jun 24 '16 at 14:19

1 Answers1

2

There is no method createUserWithEmailAndPassword in Firebase 3.0.5 for node.js, look at documentation

libik
  • 22,239
  • 9
  • 44
  • 87