简体   繁体   English

如何在 Mongo Stitch Email 确认 URL 中使用深层链接?

[英]How can I use deep links in Mongo Stitch Email Confirmation URLs?

I want to configure a Mongo Stitch App to confirm users via e-mail.我想配置一个 Mongo Stitch App 以通过电子邮件确认用户。 I'd like to use a deep link to link directly into my react native expo app.我想使用深层链接直接链接到我的反应原生 expo 应用程序。 During development the link would be "exp://localhost:19000/".在开发过程中,链接将是“exp://localhost:19000/”。 The link correctly reaches my app.该链接正确到达我的应用程序。

Unfortunately Stitch under "Auth Providers > Edit local-userpass" does not accept this link.不幸的是,“Auth Providers > Edit local-userpass”下的 Stitch 不接受此链接。 The error message is:错误信息是:

"Please enter a URL beginning with a valid scheme such as https:// or http://" “请输入以有效方案开头的 URL,例如 https:// 或 http://”

To replicate this error:要复制此错误:

  1. Setup a stitch app as described in the docs: https://www.mongodb.com/cloud/stitch按照文档中的说明设置缝合应用程序: https://www.mongodb.com/cloud/stitch

  2. In the stitch settings under "Users > Providers" enable "Email/Password" and go into the config settings for this authorization method.在“用户 > 提供者”下的缝合设置中,启用“电子邮件/密码”和 go 进入此授权方法的配置设置。 There, choose "Send a confirmation email".在那里,选择“发送确认电子邮件”。

  3. You are now prompted to configure a "Email Confirmation URL".现在会提示您配置“电子邮件确认 URL”。 Apparently this can not be a deep link to an expo app.显然这不可能是 expo 应用程序的深层链接。 The link needs to start with http or https but expo deep links start with "epx" as outlined here https://docs.expo.io/versions/latest/workflow/linking/#linking-module . The link needs to start with http or https but expo deep links start with "epx" as outlined here https://docs.expo.io/versions/latest/workflow/linking/#linking-module .

Any help would be greatly appreciated!任何帮助将不胜感激!

Currently the only URL schemes supported for Email Confirmation URL is http and https . Currently the only URL schemes supported for Email Confirmation URL is http and https .

However, you can create a custom flow using Run A Confirmation Function .但是,您可以使用Run A Confirmation Function创建自定义流程。 Whenever a new user registers an account, the custom confirmation function will be executed with the tokens.每当新用户注册帐户时,将使用令牌执行自定义确认 function。 The function could send an email containing a deep link and set the registration status to pending . function 可以发送包含深层链接的 email 并将注册状态设置为pending

Then the client application must call the confirmUser SDK function to fully confirm the user's identity and allow login.然后客户端应用程序必须调用confirmUser SDK function 以完全确认用户的身份并允许登录。 For an example of user confirmation, see Confirm a New User's Email Address .有关用户确认的示例,请参见确认新用户的 Email 地址

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM