Raya Levinson
Raya Levinson

Reputation: 103

Customized email verification success page using Firebase

I am generating email verification using the default Firebase function. The default email verification success page looks like that:

image

I want to customize the response page after successful email verification. Is there a way to do that?

Upvotes: 5

Views: 1063

Answers (1)

Renaud Tarnec
Renaud Tarnec

Reputation: 83068

I want to customize the response page after successful email verification. Is there a way to do that?

Yes, as Frank indicated in his above comment, it is possible and the documentation he refers to explains the mechanism.

As explained in this doc (and also in my other answer :-) ), you need to build a web page in which you will:

  1. Get the values passed as QueryString parameters (e.g. mode or oobCode)
  2. Call, from this web page, the applyActionCode() method of the Firebase JavaScript SDK, passing the values of these parameters to the method.
  3. Upon successful verification, do something, like redirect the user to your app login page.

What's important to note is that you have two ways to generate the email sent to the user (which contains the link to the page described above):

1. Rely on the default Firebase mail mechanism. In order to customize the URL of the verification link (e.g. you want to redirect to https://www.myrapp.com/emailVerifyScreen) you need to change the base URL as shown in the below image ("Customize action URL"). Also explained here in the doc.

enter image description here

2. Send the email through a Cloud Function (or through a server you own). In this case you need to:

a/ Call the generateEmailVerificationLink() method of the Admin SDK, which returns a link

b/ Generate an email containing this link

c/ Send the email to the user (via an SMTP server you control or via a microservice like Mailjet or Sendgrid)


You may have a look at these other answers:

Upvotes: 6

Related Questions