本文整理汇总了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));
}
}
});
}
开发者ID:firebase,项目名称:FirebaseUI-Android,代码行数:26,代码来源:RecoverPasswordActivity.java
示例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();
}
}
});
}
开发者ID:firebase,项目名称:FirebaseUI-Android,代码行数:36,代码来源:SignInDelegate.java
注:本文中的com.google.firebase.auth.FirebaseAuthInvalidUserException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论