Skip to content

[v3] Missing function for promisify (verification email) #248

Open
@xzilja

Description

@xzilja

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions