Try to develop login page in swift then I want to validate certain condition for error return.
from print(Error.localizeDescription) I get some return like
- The password is invalid or the user does not have a password.
- There is no user record corresponding to this identifier.
How to validate that condition based on Error.localizeDescription ?
Auth.auth().signIn(withEmail: email, password: pass, completion: {[weak self] result, Error in
guard let StrongSelf = self else{
return
}
if let Error = Error {
print(Error.localizedDescription)
}
guard Error == nil else{
// in here there is validation of return error (e.g. wrong password, account not exist)
self?.reasonLabel.isHidden=false
self?.reasonLabel.text=Error
return
}
self!.checkinfo()
})