带有多个问号的角度句柄查询参数



我正在尝试处理Firebase自动生成的电子邮件确认链接,该链接将进入我在web平台上的Ionic/Angular应用程序。我尝试过Deeplink cordova插件(文档说它支持网络(,但返回";cordova_ not_available";错误我尝试过电容器应用程序插件,但它在浏览器上返回默认的空字符串。我尝试过调用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参数,这是我需要确认用户拥有该电子邮件地址的参数

有没有办法获得完整的链接?

我终于发现,通过在sendPasswordResetEmail或sendEmailVerification Firebase方法的actionCodeSettings参数中设置handleCodeInApp = false,Firebase自动生成的链接恰好只有一个问号(我不知道为什么(,因此可以通过location.toString()管理它来检索oobCode。

最新更新