【发布时间】:2020-12-12 07:12:17
【问题描述】:
我一直在尝试从新的 https://firebase.flutter.dev/ Firebase 身份验证中捕获异常但失败了。 不知道出了什么问题,这是我使用电子邮件和密码功能登录的代码:
try {
UserCredential userCredential = await _firebaseAuth
.signInWithEmailAndPassword(email: email, password: password);
if (userCredential != null) {
_user = userCredential.user;
}
} on FirebaseAuthException catch (e) {
print(e.code);
} on PlatformException catch (e) {
print(e.message);
} catch (e) {
print(e.toString());
}
return _user;
}
【问题讨论】:
-
你能发布错误吗?
-
发生异常。 PlatformException (PlatformException(firebase_auth, com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: 密码无效或用户没有密码。, {code: wrong-password, additionalData: {}, message: 密码无效或用户没有密码。}))
标签: firebase flutter firebase-authentication