gpt4 book ai didi

firebase - RNFirebase 邮箱验证

转载 作者:行者123 更新时间:2023-12-04 16:42:14 25 4
gpt4 key购买 nike

我正在尝试向那些从我的应用程序注册的用户发送电子邮件,但我收到了 auth/internal-error 作为响应。有人可以帮我解决这个问题吗???

          var currentUser = firebase.auth().currentUser;
var actionCodeSettings = {
url: WEBSITE,
iOS: {
bundleId: getBundleIdentifier()
},
android: {
packageName: getBundleIdentifier(),
installApp: false,
minimumVersion: '1'
},
handleCodeInApp: false,
dynamicLinkDomain: getDynamicLink()
};
currentUser.sendEmailVerification(actionCodeSettings).then(function () {
console.log('email sent');
}, function (error) {
console.log('email not sent ' + error);
});

这是我用来向注册或登录用户发送电子邮件的代码,下面是我记录的控制台错误

Error: An internal error has occurred, please try again.
at createErrorFromErrorData (NativeModules.js:155)
at NativeModules.js:104
at MessageQueue.__invokeCallback (MessageQueue.js:414)
at MessageQueue.js:127
at MessageQueue.__guard (MessageQueue.js:314)
at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:126)
at debuggerWorker.js:80

详细错误描述:

code: "auth/internal-error"
domain: "FIRAuthErrorDomain"
framesToPop: 1
nativeStackIOS: (15) ["0 [PROJECT_ID] 0x000000010570380c RCTJSErrorFromCodeMessageAndNSError + 156", "1 [PROJECT_ID] 0x00000001… processMethodSignature]_block_invoke_2.129 + 176", "2 [PROJECT_ID] 0x00000001…baseAuth promiseRejectAuthException:error:] + 292", "3 [PROJECT_ID] 0x00000001…odeSettings:resolver:rejecter:]_block_invoke + 92", "4 [PROJECT_ID] 0x00000001…904 __callInMainThreadWithError_block_invoke + 56", "5 libdispatch.dylib 0x00000001…658 721C34EF-4ABD-395F-8285-FECAA2457BA3 + 370264", "6 libdispatch.dylib 0x00000001…1cc 721C34EF-4ABD-395F-8285-FECAA2457BA3 + 373196", "7 libdispatch.dylib 0x00000001…3290 721C34EF-4ABD-395F-8285-FECAA2457BA3 + 53904", "8 CoreFoundation 0x00000001…c74 6E8ED431-E507-3897-BF3A-AFD3D4C2C49F + 691316", "9 CoreFoundation 0x00000001…c68 6E8ED431-E507-3897-BF3A-AFD3D4C2C49F + 670824", "10 CoreFoundation 0x00000001aac6b16c CFRunLoopRunSpecific + 464", "11 GraphicsServices 0x00000001b4aa3328 GSEventRunModal + 104", "12 UIKitCore 0x00000001aecd5d0c UIApplicationMain + 1936", "13 [PROJECT_ID] 0x0000000104a90e5c main + 124", "14 libdyld.dylib 0x00000001…f6424 8F3A474D-45CC-3991-829F-77B3B151BA86 + 5156"]
userInfo: {FIRAuthErrorUserInfoNameKey: "ERROR_INTERNAL_ERROR", NSLocalizedDescription: "An internal error has occurred, print and inspect the error details for more information.", NSUnderlyingError: {…}}
message: "An internal error has occurred, please try again."
stack: "Error: An internal error has occurred, please try again.↵ at createErrorFromErrorData (blob:http://localhost:8081/c7064c8e-a43f-4040-a949-22732e1989f3:2126:17)↵ at blob:http://localhost:8081/c7064c8e-a43f-4040-a949-22732e1989f3:2078:27↵ at MessageQueue.__invokeCallback (blob:http://localhost:8081/c7064c8e-a43f-4040-a949-22732e1989f3:2645:18)↵ at blob:http://localhost:8081/c7064c8e-a43f-4040-a949-22732e1989f3:2376:18↵ at MessageQueue.__guard (blob:http://localhost:8081/c7064c8e-a43f-4040-a949-22732e1989f3:2549:13)↵ at MessageQueue.invokeCallbackAndReturnFlushedQueue (blob:http://localhost:8081/c7064c8e-a43f-4040-a949-22732e1989f3:2375:14)↵ at http://localhost:8081/debugger-ui/debuggerWorker.js:80:58"
__proto__: Object

最佳答案

考虑一下:

  • 您只能向使用 Email&Password 方法创建的用户发送电子邮件验证 createUserWithEmailAndPassword
  • 签名成功后,Firebase 将返回一个授权对象的 promise 。
  • 旧的 onAuth 方法已更改为 onAuthStateChanged

检查电子邮件已验证:

firebase.auth().onAuthStateChanged(function(user) { 
if (user.emailVerified) {
user.sendEmailVerification();
}
else {
console.log('Not verified');
}
});

关于firebase - RNFirebase 邮箱验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58110609/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com