Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

firebase createUserWithEmailAndPassword wrong error on ios #130

Closed
@atlanteh

Description

@atlanteh

We have firebase up and running in our app. We tried adding fetch-blob to add files to firebase storage.
However suddenly firebase started producing us wrong message on createUserWithEmailAndPassword.

Normally when we create a user with createUserWithEmailAndPassword, the Promise should reject with error.code "auth/email-already-in-use" when the email is already in use.
However when adding fetch-blob, firebase suddenly takes quite a few seconds to return and has error.code "auth/network-request-failed" .
This happens only if the polyfill is added and only in ios.

Running the following code twice fails for us:

import firebase from '../Services/firebase'; // firebase with auth..
import RNFetchBlob from 'react-native-fetch-blob';

const polyfill = RNFetchBlob.polyfill;

window.XMLHttpRequest = polyfill.XMLHttpRequest;
window.Blob = polyfill.Blob;

const email = 'test@gmail.com';
const password = '123456';
const firebaseAuth = firebase.auth();
firebaseAuth.createUserWithEmailAndPassword(email, password)
.catch(err => {
    alert(error.code); // Should be "auth/email-already-in-use". Instead we get "auth/network-request-failed"
});

Versions
react-native-fetch-blob: 0.9.4
react-native: 0.32.0

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions