[ios]swift firebase auth email login방법
private func loadFireBaseSignIn(email : String , password : String)
{
Auth.auth().signIn(withEmail: email, password: password) { authResult, error in
if let error = error
{
if let errorCode : AuthErrorCode = AuthErrorCode(rawValue: error._code)
{
print("-> error -> \(error.localizedDescription) -> code -> \(errorCode.rawValue)")
switch errorCode.rawValue
{
case AuthErrorCode.invalidEmail.rawValue:
self.makeAlert(title: "error", msg: "이메일 양식이 맞지 않습니다.")
return
case AuthErrorCode.wrongPassword.rawValue:
self.makeAlert(title: "error", msg: "페스워드가 틀렸습니다.")
return
case AuthErrorCode.userNotFound.rawValue:
self.makeAlert(title: "error", msg: "회원등록 되지 않았습니다.")
return
case AuthErrorCode.operationNotAllowed.rawValue:
self.makeAlert(title: "error", msg: "error -> operationNotAllowed")
return
case AuthErrorCode.userDisabled.rawValue:
self.makeAlert(title: "error", msg: "error -> userDisabled")
return
default:
self.makeAlert(title: "error", msg: "error -> \(error.localizedDescription) -> code -> \(errorCode.rawValue)")
return
}
}
}
else
{
//success login
if let user = authResult?.user
{
}
else
{
}
}
}
}
'ios,swift' 카테고리의 다른 글
[ios]swift firebase auth password update 방법 (0) | 2020.03.30 |
---|---|
[ios]swift firebase auth password reset mail 보내는방법 (0) | 2020.03.30 |
[ios]swift fireabse auth email 회원가입 방법 (0) | 2020.03.30 |
[ios]swift firebase Auth displayname, photoURL 바꾸는 방법 (0) | 2020.03.30 |
[ios]firebase auth error site (0) | 2020.03.27 |