Firebase kicks out current user

前端 未结 14 1786
一个人的身影
一个人的身影 2020-11-22 01:42

So I have this issue where every time I add a new user account, it kicks out the current user that is already signed in. I read the firebase api and it said that \"I

14条回答
  •  迷失自我
    2020-11-22 02:14

    On the web, this is due to unexpected behavior when you call createUserWithEmailAndPassword out of the registration context; e.g. inviting a new user to your app by creating a new user account.

    Seems like, createUserWithEmailAndPassword method triggers a new refresh token and user cookies are updated too. (This side-effect is not documented)

    Here is a workaround for Web SDK: After creating the new user;

    firebase.auth().updateCurrentUser (loggedInUser.current)
    

    provided that you initiate loggedInUser with the original user beforehand.

提交回复
热议问题