firebaseWebSDK.auth().signInWithCustomToken(customToken) .then(user => { let nextStep let message // check if returned user has "email" field set.. if (!user.email) { message = 'Signed up user, saved: email, password, and display name.' const usersRef = firebaseServerSDK.database().ref('users') nextStep = Promise.all([ user.updateEmail(email), user.updatePassword(password), user.updateProfile({ displayName }), usersRef.child(user.uid).set({ displayName, email }), ]) } else { message = `User already exists for that email: ${email}` nextStep = Promise.resolve(null) } nextStep.then(() => { delete req.session.user return res.json({ message }) }) .catch(updateError => res.json({ error: updateError.message })) }) .catch(signInError => { const errorCode = signInError.code const errorMessage = signInError.message return res.json({ type: 'signInError', errorCode, errorMessage }) })
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/e8789234-95be-4e2f-91a8-aae084c2b301%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
firebase.initializeApp({
...
databaseAuthVariableOverride: { uid: '...' }
})
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/e8789234-95be-4e2f-91a8-aae084c2b301%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/8fb286dd-7388-430b-94f9-a12f78429c45%40googlegroups.com.