本文整理汇总了Java中com.google.firebase.auth.FirebaseAuthInvalidUserException类的典型用法代码示例。如果您正苦于以下问题:Java FirebaseAuthInvalidUserException类的具体用法?Java FirebaseAuthInvalidUserException怎么用?Java FirebaseAuthInvalidUserException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FirebaseAuthInvalidUserException类属于com.google.firebase.auth包,在下文中一共展示了FirebaseAuthInvalidUserException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: next
import com.google.firebase.auth.FirebaseAuthInvalidUserException; //导入依赖的package包/类
private void next(final String email) {
getAuthHelper().getFirebaseAuth()
.sendPasswordResetEmail(email)
.addOnFailureListener(
new TaskFailureLogger(TAG, "Error sending password reset email"))
.addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
getDialogHolder().dismissDialog();
RecoveryEmailSentDialog.show(
email, getSupportFragmentManager());
}
})
.addOnFailureListener(this, new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
getDialogHolder().dismissDialog();
if (e instanceof FirebaseAuthInvalidUserException) {
// No FirebaseUser exists with this email address, show error.
mEmailEditText.setError(getString(R.string.fui_error_email_does_not_exist));
}
}
});
}
示例2: signInWithEmailAndPassword
import com.google.firebase.auth.FirebaseAuthInvalidUserException; //导入依赖的package包/类
/**
* Begin sign in process with email and password from a SmartLock credential. On success, finish
* with {@link Activity#RESULT_OK}. On failure, delete the credential from SmartLock (if
* applicable) and then launch the auth method picker flow.
*/
private void signInWithEmailAndPassword(String email, String password) {
final IdpResponse response =
new IdpResponse.Builder(new User.Builder(EmailAuthProvider.PROVIDER_ID, email).build())
.build();
getAuthHelper().getFirebaseAuth()
.signInWithEmailAndPassword(email, password)
.addOnSuccessListener(new OnSuccessListener<AuthResult>() {
@Override
public void onSuccess(AuthResult authResult) {
finish(Activity.RESULT_OK, response.toIntent());
}
})
.addOnFailureListener(new TaskFailureLogger(
TAG, "Error signing in with email and password"))
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
if (e instanceof FirebaseAuthInvalidUserException
|| e instanceof FirebaseAuthInvalidCredentialsException) {
// In this case the credential saved in SmartLock was not
// a valid credential, we should delete it from SmartLock
// before continuing.
deleteCredentialAndRedirect();
} else {
startAuthMethodChoice();
}
}
});
}