3
I already have a main login with Firebase auth. But I need to implement another login within that system, because the client can add other administrators. The login will be simple even, just check if the password and email check.
I have this method that logs in:
public void retrive(String uid, String senha) {
raiz
.child(CHILD) // ex: adms
.child(uid) // ex: rafael@email
.equalTo(senha,"senha")
.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if (dataSnapshot.getValue() != null) {
// ok
}else {
// false
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
//false
}
});
}
My Firebase Json looks like this: Adm father and children:
{
"rafael@gmailcom": {
"ativo": true,
"codigo": "rafael@gmailcom",
"dataNascimento": 944515274,
"email": "[email protected]",
"nome": "Rafael Aparecido da silva",
"privilegios": {
"ACESSO_FINANCEIRO": true,
"AGENDAR_CONSULTA": false,
"CADASTRO_PACIENTE ": false,
"CADASTRO_PACIENTE_": false,
"MANTER_ADM": false,
"RECEBER_PAGAMENTO": true
},
"senha": "teste"
}
}
I can’t get it to bring the desired user.