如何使用数据库中提供的电子邮件而不是 w=on 身份验证从 Firebase 发送忘记密码请求



我已使用移动ID注册用户

 String id = Settings.Secure.getString(getApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID) + "@gmail.com";

现在要求用户设置 PIN 并将其存储在数据库中让我们说

String Confirmed_Pin = "123456789";
String pass=Confirmed_Pin;
mAuth.createUserWithEmailAndPassword(id, pass);

现在要求用户提供电子邮件和手机并将其存储在实时数据库中 现在,如果用户忘记了密码,如何发送忘记密码并通过数据库中的电子邮件进行更改,这可能吗?

或者如何使用移动设备更新此ID

我知道这一点,但无法通过数据库进行:

mAuth.sendPasswordResetEmail(email);

使用此代码块。希望它会有所帮助。

FirebaseAuth.getInstance().sendPasswordResetEmail("user@example.com")
    .addOnCompleteListener(new OnCompleteListener<Void>() {
        @Override
        public void onComplete(@NonNull Task<Void> task) {
            if (task.isSuccessful()) {
                Log.d(TAG, "Email sent.");
            }
        }
    });

最新更新