javascript - Firebase create user "manually" - Stack Overflow

I'm using the standard Email + Password auth-provider.Through certain circumstances I have to crea

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 calling a REST api with an defined email + generated password, and if succeeded sending a wele email to the user with his password. Something like forward user registration.

I read through their docs and couldn't find much. (the new docs don't even offer a REST API section for user management.. well and just to be clear, the new "google" styled docs, pretty much suck anyway :) ).

Is there someone who has already done something similar and can help me out?

BTW: It would also be possible to create them client side through createUserWithEmailAndPassword(), but this function does automatically reauthenticate the new user, which must not happen in my scenario. Is it possible to use createUserWithEmailAndPassword() without automatically logging in the user?

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 calling a REST api with an defined email + generated password, and if succeeded sending a wele email to the user with his password. Something like forward user registration.

I read through their docs and couldn't find much. (the new docs don't even offer a REST API section for user management.. well and just to be clear, the new "google" styled docs, pretty much suck anyway :) ).

Is there someone who has already done something similar and can help me out?

BTW: It would also be possible to create them client side through createUserWithEmailAndPassword(), but this function does automatically reauthenticate the new user, which must not happen in my scenario. Is it possible to use createUserWithEmailAndPassword() without automatically logging in the user?

Share Improve this question edited May 31, 2016 at 20:55 Frank van Puffelen 601k85 gold badges890 silver badges860 bronze badges asked May 31, 2016 at 18:44 LukasLukas 1,3767 gold badges24 silver badges51 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

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('[email protected]', 'asuperrandompassword');

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745091659a4610728.html

相关推荐

  • javascript - Firebase create user "manually" - Stack Overflow

    I'm using the standard Email + Password auth-provider.Through certain circumstances I have to crea

    10小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信