java - 尝试将密码添加到 Firebase 实时数据库,但没有显示?
问题描述
所以我知道 Firebase Auth 存在,但这是一个学校项目,我必须为密码实现自己的哈希。
我正在将用户注册到实时数据库,它以正确的格式添加,但“密码”没有显示。有没有办法让它显示出来?
这是一些示例代码
public void registerUser (String name, String email, String password)
{
Intent toWelcome = new Intent(this, Welcome.class);
String id = mDatabase.push().getKey();
if (type.equals("Admin")) {
Person user = new Admin(id, email, password, name);
mDatabase.child("Person").child("Admin").child(id).setValue(user);
Toast.makeText(Register.this, "Admin account already created.", Toast.LENGTH_LONG).show();
}
else if (type.equals("Patient"))
{
Person user = new Patient(id, email, password, name);
mDatabase.child("Person").child("Patient").child(id).setValue(user);
}
else if (type.equals("Employee"))
{
Person user = new Employee(id, email, password, name);
mDatabase.child("Person").child("Employee").child(id).setValue(user);
}
toWelcome.putExtra("name", name);
toWelcome.putExtra("role", type);
startActivity(toWelcome);
}
这是我的数据库中显示的内容:
有任何想法吗?
解决方案
您确定它应该向您显示密码吗?服务器通常非常不愿意向管理员显示此类内容。它可能是一项安全功能。作为管理员,您可以重置密码,但不一定能看到密码。你确实提到它是一个实时数据库。
推荐阅读
- python - Keras 值错误中的自定义损失函数
- javascript - 如何在 Vuejs 中的变量中传递方法名称
- maven-3 - 无法让 maven-assembly-plugin 打包测试
- jquery - jQuery 函数仅在我手动将窗口大小调整为移动设备而不是刷新时才有效
- java - 如何将项目输入资源放在 JAR 之外,如 Lib 文件夹
- python - TypeError 输出似乎倒退
- google-apps-script - Google 表格 - 用于将表格导出为仅包含值和格式的 xls 的按钮 - 不是公式
- rust - 如何从更高级别的特征绑定特征返回关联类型?
- r - 如何在不使用移位功能的情况下引用数据表(R)中的上一行?
- android - 如何在反应原生 TVEventHandler 中检测保持和快进事件