0

を失敗し、私もthisを読んで、私はこの例外の解決策を見つけることができません。Firebase /ネイティブリアクト - アサーションは、私は多くの情報を見つけることができませんでしれる問題を抱えている

アサーションに失敗しました:opt_onRejected関数でなければなりません。 opt_contextを3番目の引数ではなく2番目の引数として渡しましたか?ここ

例外をスローし、私の関数である。

const {currentUser} = firebase.auth() 
    const credential = firebase.auth.EmailAuthProvider.credential(
    currentUser.email, 
    password) 

    return (dispatch) => { 
    currentUser.reauthenticate(credential) // 1. Re-authenticate 
    .then(
    console.log("RE-AUTH"), 
    currentUser.updateEmail(strEmail) // 2. Update email 
    .then(
     console.log("MAIL UPDATE"), 
     firebase.database().ref(`users/${currentUser.uid}/`) // 3. Update profile email 
     .update({email}) 
     .then(console.log("PROFILE UPDATE")) 
     .catch(error => console.log(error)) 
    ) 
     .catch(error => console.log(error)) 
    ) 
    .catch(error => console.log(error)) 
    } 

それがメールアドレスを変更するとそれは動作しますが、例外が示しています...

答えて

0

は、問題を修正、私はへconsole.log()以上を追加しました 答えが正しく処理されていないことを確認してください(link)。

誰もが電子メールの変更のための作業アクションが必要な場合:

currentUser.reauthenticate(credential) // Re-authenticate 
.then(() => { 
    currentUser.updateEmail(strEmail) // Update email 
    .then(() => { 
    firebase.database().ref(`users/${currentUser.uid}/`) // Update profile email 
    .update({email}) 
    .then(() => 
     Alert.alert("Modification saved."), 
     emailSaveSuccess(dispatch) 
    ) 
    .catch(error => console.log(error)) 
    }) 
    .catch(error => emailSaveError(dispatch, error)) 
}) 
.catch(error => emailSaveError(dispatch, error)) 
関連する問題