在带有操作 URL 的电子邮件模板中将 Firebase 项目名称替换为自定义域 [英] Replace Firebase Project Name with Custom Domain in Email Templates with Action URL

查看:20
本文介绍了在带有操作 URL 的电子邮件模板中将 Firebase 项目名称替换为自定义域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景

Firebase 身份验证发送用于注册、更改密码等的电子邮件.这些电子邮件包含指向我项目的内部 Firebase 名称的链接.

问题

我想用我的自定义域替换该内部名称,这似乎可以通过更改操作 URL 和使用动态链接来实现.

我不想用自己的代码处理电子邮件操作,而只想用自定义域替换 Firebase 域.这是关于发送包含自定义域链接的电子邮件,因此看起来不错.

现有答案

存在答案,但我不明白这究竟是如何工作的.由于我的声誉太低,我无法发表评论.

解决方案

可以将电子邮件模板中的 Firebase 操作 URL 更改为自定义域,而无需实施电子邮件操作处理程序代码,而是依赖于现有的 Firebase 功能.

在 Firebase 控制台中:

  1. 转到动态链接

  2. 添加网址前缀,方法是输入您的自定义域 YOURDOMAIN.com.无需实际添加动态链接,仅此条目就足够了.

  3. 转到身份验证 >模板 >编辑(铅笔) >自定义操作网址

  4. 根据此模式输入您的自定义域(注意两个下划线):

https://YOURDOMAIN.com/__/auth/action

  1. 通过注册到您的应用程序并单击电子邮件中的链接来发送电子邮件.该链接会将您带到处理操作的默认 Firebase 页面.

Background

Firebase Authentication sends out emails for registration, password change etc. These emails contain links with the internal Firebase name of my project.

Problem

I want to replace that internal name with my custom domain, which seems to be possible by changing the Action URL and using a Dynamic Link.

I do not want to handle the email actions with my own code, but just replace the Firebase domain with a custom domain. It is about sending emails that are containing links with a custom domain and thus look nice.

Existing Answer

An answer exists, but I do not understand how this exactly works. And I am not able to comment as my reputation is too low.

https://stackoverflow.com/questions/46972194/how-to-customize-firebase-action-url-for-password-reset-and-email-verification#:~:text=You%20just%20need%20to%20create,Dynamic%20Link%20and%20hit%20done.

Illustration

解决方案

It is possible change the Firebase action URL in email templates to one's custom domain without implementing email action handler code but relying on the already existing firebase functionality.

In the Firebase Console:

  1. Go to Dynamic Links

  2. Add URL Prefix by entering your custom domain YOURDOMAIN.com. No need to actually add a Dynamic Link, this entry alone is sufficient.

  3. Go to Authentication > Template > Edit (Pencil) > Customize Action URL

  4. Enter your custom domain according to this pattern (note the TWO underscores):

https://YOURDOMAIN.com/__/auth/action

  1. Send out an email by registering to your App and click the link in the email. The link will bring you to the default Firebase page handling the action.

这篇关于在带有操作 URL 的电子邮件模板中将 Firebase 项目名称替换为自定义域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆