0
votes

I am using the Firebase Emulator for local testing. I have a signupUser Firebase Function that uses Firebase Auth to sign up users (and does some extra work). Both of them use the Emulator, and the issue is, this way the email verification URL does not get printed neither to the console (in which I run the Emulator) nor to the Functions Log. As a result, I cannot verify my new test users and cannot log in. Is there any other way to verify these test users' email addresses or to manually print the verification URL?

1
Do you need to create a new user every time?Julia
At this point not necessarily. Later on it would be nice though, for e2e tests around the sign up flow.Gábor Pintér

1 Answers

1
votes

Ok, I've found it. Using the Admin SDK we can generate a verification link, that we can then console log.

import * as admin from 'firebase-admin';
admin.auth().generateEmailVerificationLink(useremail, actionCodeSettings)

Docs: https://firebase.google.com/docs/auth/admin/email-action-links#generate_email_verification_link