Swift: Firebase Chat App Part 4 - Set Up Firebase & Email/Pass Log In (Real-time) - Xcode 11 - 2022
Firebase Auth
): 자체 설정 이메일 가입 및 로그인...
FirebaseAuth.Auth.auth().createUser(withEmail: email, password: password) { [weak self] result, error in
guard
let self = self,
let result = result,
error == nil else {
return
}
let user = result.user
print("Create User: \(user)")
}
Firebase Auth
에 이메일 인증 기능을 활성화한 뒤 createUser
함수를 통해 유저 생성...
FirebaseAuth.Auth.auth().signIn(withEmail: email, password: password) { [weak self] result, error in
guard
let self = self,
let result = result,
error == nil else {
print("Failed to sign in user with email: \(email)")
DispatchQueue.main.async {
self?.alertUserLoginError("Failed to sign in your email")
}
return
}
}