react-native-firestack icon indicating copy to clipboard operation
react-native-firestack copied to clipboard

[v3] Missing function for promisify (verification email)

Open xzilja opened this issue 9 years ago • 6 comments

I am running into following error

ExceptionsManager.js:71 Error: Missing function for promisify. at index.js:235 at tryCallTwo (core.js:45) at doResolve (core.js:200) at new Promise (core.js:66) at index.js:235 at User.sendEmailVerification (auth.js:107) at FsendEmailVerification (firebase.js:24) at userSendEmailVerification (_user.js:10) at _user.js:21 at tryCallOne (core.js:37) reactConsoleErrorHandler @ ExceptionsManager.js:71 console.error @ YellowBox.js:61 (anonymous) @ _user.js:12 tryCallOne @ core.js:37 (anonymous) @ core.js:123 (anonymous) @ JSTimers.js:100 callTimer @ JSTimersExecution.js:95 callImmediatesPass @ JSTimersExecution.js:199 callImmediates @ JSTimersExecution.js:214 (anonymous) @ MessageQueue.js:214 guard @ MessageQueue.js:46 __callImmediates @ MessageQueue.js:214 (anonymous) @ MessageQueue.js:128 guard @ MessageQueue.js:46 invokeCallbackAndReturnFlushedQueue @ MessageQueue.js:126 (anonymous) @ debuggerWorker.js:71 index.js:7

This started occurring after implementing sendEmailVerification in the following way

firebase.js

import Firestack from 'react-native-firestack';


/**
 * @desc root firebase node
 * @type {Firestack}
 */
export const firebase = new Firestack();


/**
 * @desc create user with email and password
 * @param {String} [email='']
 * @param {String} [password='']
 */
export const FcreateUserWithEmailAndPassword = (email = '', password = '') =>
  firebase.auth().createUserWithEmailAndPassword(email, password);


/**
 * @desc send user verification email
 */
export const FsendEmailVerification = () =>
  firebase.auth().currentUser.sendEmailVerification();

redux actions (using redux-thunk) (_user.js)

const userSendEmailVerification = () => {
  FsendEmailVerification()
    .then(() => console.log('Email sent successfully'))
    .catch(err => console.error(err));
};

export const userCreate = (email, password, repeatPassword) =>
  (dispatch) => {
    if (VpasswordsMatch(password, repeatPassword)) {
      dispatch({ type: CREATE_REQUEST });
      FcreateUserWithEmailAndPassword(email, password)
        .then((user) => {
          userSendEmailVerification();
          dispatch({ type: CREATE_SUCCESS, payload: user });
        })
        .catch(err => console.error(err));
    } else {
      console.error('Passwords do not match');
    }
  };

Issue pops up in console, user is created but no verification email is sent

Error seems to be produced by catch statement from FsendEmailVerification

Update error screenshot

Imgur

xzilja avatar Jan 17 '17 18:01 xzilja

@Salakar looks like js related error to me, do you by any chance have an idea of where this is coming from? I could prob pr this bug, just having issues pinpointing source.

xzilja avatar Jan 19 '17 11:01 xzilja

@IljaDaderko am guessing this is ios?

Looks like the method doesn't exist on the native ios side - hasn't been implemented, it's there on android but not ios.

@chrisbianca any chance you could work this in sometime for ios? =] Auth module on ios is just missing the sendEmailVerification method

Salakar avatar Jan 23 '17 18:01 Salakar

+1, this would be very handy indeed.

skizzo avatar Jan 29 '17 10:01 skizzo

@IljaDaderko @skizzo we're starting work on our ios version of our app next week, so a lot of ios things will be updated, expect changes then, we're busy at the moment prepping our android app for release this week, sorry!

Salakar avatar Jan 30 '17 10:01 Salakar

Any movement on this? The Firestack user object is without the method sendEmailVerification. See: https://firebase.google.com/docs/auth/web/manage-users#send_a_user_a_verification_email

Is there any reason Firestack can't simply return the user that Firebase returns?

AndrewHenderson avatar Feb 28 '17 02:02 AndrewHenderson

+1

smkhalsa avatar Mar 01 '17 02:03 smkhalsa