How can I use firebase's language code (myFirebase.auth().languageCode) in my action link URL in Firebase Authentication email template?

475 views
Skip to first unread message

Erwin Leonardy

unread,
Jan 28, 2020, 11:37:17 PM1/28/20
to Firebase Google Group

So, my website, which is built using ReactJS, provides multi-language support and my routes are formatted in this manner:

http://localhost:3000/<alpha-2-country-code>/<action>

I am trying to use Firebase Authentication to verify the email address that is provided by the user during sign up. This is the verify email link that I got from Firebase Authentication:

http://localhost:3000/new-account?mode=verifyEmail&oobCode=XXX&apiKey=XXX&lang=fr

My current React Project setup is that I am going to redirect users to an Error Page 404 when the alpha-2-country-code is not specified before the action.

My question is, is there a way to extract the fr from the myFirebase.auth().languageCodeso that I can append it to my action link URL in Firebase Authentication email template? I couldn't find anything related to this in the official documentation.

The action link URL that i expect Firebase to produce is

http://localhost:3000/fr/new-account?mode=verifyEmail&oobCode=XXX&apiKey=XXX&lang=fr

Thanks in advance!

Reply all
Reply to author
Forward
0 new messages