ionic-framework - 带有多个问号的角度句柄查询参数
问题描述
我正在尝试将 Firebase 自动生成的电子邮件确认链接处理到我在网络平台上的 Ionic/Angular 应用程序中。我尝试过使用 Deeplink cordova 插件(文档说它支持 Web),但返回“cordova_not_available”错误。我试过使用电容器 App 插件,但它在浏览器上返回一个默认的空字符串。我试过调用location.toString()
,但链接在查询参数值中包含多个问号,并且从第二个问号开始的所有内容都被删除。Firebase 生成的链接如下所示:
https://example.com?link=https://example.com?apiKey%3D{myApiKey}%26mode%3DverifyEmail%26oobCode%3D{theCodeIneed}%26continueUrl%3Dhttps://example.com/email-confirmed%26lang%3Den&apn=com.example.myAppName&amv&ibi=com.example.myAppName&ifl=https://example.com?apiKey%3D{myApiKey}%26mode%3DverifyEmail%26oobCode%3D{theCodeIneed}%26continueUrl%3Dhttps://example.com/email-confirmed/%26lang%3Den
但我从中得到的location.toString()
(迄今为止最好的)只是:
https://example.com?link=https://example.com
所以我无法获得oobCode参数,这是我需要确认用户拥有该电子邮件地址
有没有办法获取完整链接?
解决方案
终于发现通过handleCodeInApp = false
在sendPasswordResetEmail或sendEmailVerification Firebase方法的actionCodeSettings参数中设置,Firebase自动生成的链接恰好只有一个问号(我不知道为什么),因此可以通过location.toString()
检索来管理它oob 代码。
推荐阅读
- mysql - Freeradius 3.0 不通过 mysql 发送任何数据(radacct 表为空)
- php - PHP-CPP 返回字符串导致 strlen 而不是纯字符串
- haskell - 是否有帮助为 TH 生成的实例生成正确/非冗余上下文的函数/库/技术?
- json - 将用户数据添加到本地存储只能工作一次,之后添加的对象会被简单地覆盖?(角度 10+)
- https - 通过 ETH 进行 ESP32 OTA
- swift - JWT 令牌解码 SwiftUI
- angular - Angular - 限制用户不要使用不在 HTML 中的表单控件输入超过 5 个字符
- javascript - 自定义圆环图
- visual-studio-code - 我无法通过提示符执行任何命令
- excel - 如何将两个动态数组组合成一个公式中的动态数组?