Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I manually verify an email/password account on firebase?

I'm trying to create a demo account for my app, so that I can submit it to the iOS App Store. The app requires that your email be verified before you can use it. However, the verification emails are not coming into my [email protected] inbox, and so I cannot verify the account. Is there any way I can manually set that firebase account as verified? Thanks

like image 637
user1623331 Avatar asked Aug 09 '16 16:08

user1623331


1 Answers

This works as a cloud function.

I add the userid as a key to a child called force with any value and it triggers this function that authenticates the email.

you also must include

const admin = require('firebase-admin');

cloud function

  exports.forceQue = functions.database.ref('/force/{uid}').onWrite((data,context) => {

  if (!data.after.exists()) {
      return false;
  }

  const uid = context.params.uid;

        admin.auth().updateUser(uid, {emailVerified: true});
        return true;
  });
like image 78
Dug Avatar answered Oct 14 '22 04:10

Dug