Ich habe ein Formular zum Erstellen von Benutzerprofilen erstellt. Aber wann immer ich einen Benutzer erstelle, habe ich ein Problem. Angemeldeter und abgemeldeter Benutzer. Bitte helfen Sie, dieses Problem zu l?sen.
const successCreate = () => { createUserWithEmailAndPassword(auth, email.value, confirmPassword.value) .then(() => { db.collection('businessForm') .add({ schoolName: schoolName.value, board: board.value, subjects: [ subject1.value, subject2.value, subject3.value, subject4.value, subject5.value, subject6.value, subject7.value, subject8.value, ], email: email.value, street: street.value, city: city.value, state: state.value, mobile: mobile.value, telephone: telephone.value, isAdmin: true, }) .then(() => { isLoading.value = false notyf.success('Account created successfully!') }) .catch((err) => { isLoading.value = false notyf.error('Something went wrong. Try again later!') }) }) .catch((err) => { isLoading.value = false notyf.error('Something went wrong. Try again later!') }) }
Alle L?sungen sind willkommen!
當(dāng)您通過(guò) Client JS SDK 的 createUserWithEmailAndPassword()
方法,成功后該用戶也將登錄到您的應(yīng)用程序,如文檔中所述。沒(méi)有辦法避免這種情況。
如果您想避免當(dāng)前用戶注銷(xiāo)(注銷(xiāo))并以新創(chuàng)建的用戶身份登錄,則需要實(shí)現(xiàn)不同的方法,例如調(diào)用使用 管理 SDK。
您可能對(duì)此感興趣文章,介紹如何使用 可調(diào)用云函數(shù),一個(gè)允許具有特定管理員角色的最終用戶創(chuàng)建其他用戶的模塊(免責(zé)聲明,我是作者)。