使用 firebase 的空 reCAPTCHA 令牌颤动

问题描述 投票:0回答:1

我向用户发送一封密码重置电子邮件,其中包含以下代码:

Future passwordReset() async {
    try {
      await FirebaseAuth.instance.sendPasswordResetEmail(email: _emailController.text.trim());
            showDialog(context: context, builder: (context) {
              return AlertDialog(content: Text("Email sent successfully!"),);
            });
    } on FirebaseAuthException catch(e) {
      print(e);
      showDialog(context: context, builder: (context) {
        return AlertDialog(content: Text(e.message.toString()),);
      });
    }
  }

但是在控制台中我得到:

I/FirebaseAuth(22362): Password reset request [email protected] with empty reCAPTCHA token
D/NetworkSecurityConfig(22362): No Network Security Config specified, using platform default
W/System  (22362): Ignoring header X-Firebase-Locale because its value was null.
W/LocalRequestInterceptor(22362): Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.
I/System.out(22362): [okhttp]:check permission begin!
I/.app(22362): The ClassLoaderContext is a special shared library.
I/System.out(22362): [okhttp]:not MMS!
I/System.out(22362): [okhttp]:not Email!
I/System.out(22362): [socket]:check permission begin!

如何将 reCAPTCHA 添加到我的应用程序?

android flutter firebase firebase-authentication
1个回答
0
投票

这个问题你解决了吗?

我在 Firebase 身份验证中的 createUserWithEmailAndPassword 方法中遇到同样的问题:

Future<Either<Failure, UserEntity>> signUpWithEmailPassword({
    required String name,
    required String email,
    required String password,
  }) async {
    try {
      try {
        final response = await authentication.createUserWithEmailAndPassword(
            email: email, password: password);
        if (response.user == null) {
          throw const ServerException("User is null!");
        }
        return Right(UserModel(
            id: response.user!.uid,
            email: email,
            name: name)); // Convert to UserEntity
      } catch (e) {
        throw ServerException(e.toString());
      }
    } catch (e) {
      return Left(Failure(e.toString()));
    }
  }

在控制台我得到:

I/FirebaseAuth(10573): Creating user with [email protected] with empty reCAPTCHA token
W/System  (10573): Ignoring header X-Firebase-Locale because its value was null.
E/FrameTracker(10573): force finish cuj, time out: J<IME_INSETS_ANIMATION::1@[email protected]>
© www.soinside.com 2019 - 2024. All rights reserved.