Firebase create user “manually”

后端 未结 1 1072
生来不讨喜
生来不讨喜 2020-12-11 07:35

I\'m using the standard Email + Password auth-provider.

Through certain circumstances I have to create a firebase user manually. The flow would be something like cal

相关标签:
1条回答
  • 2020-12-11 07:55

    You can create a new Firebase App context in your client and then call createUserWithEmailAndPassword() there:

    var authApp = firebase.initializeApp({
      // ...
    }, 'authApp');
    var detachedAuth = authApp.auth();
    
    detachedAuth.createUserWithEmailAndPassword('foo@example.com', 'asuperrandompassword');
    

    By adding a second argument to initializeApp you create a separate context that will not trigger re-authentication upon user creation.

    0 讨论(0)
提交回复
热议问题