I have small problem in my project, it throw an error as a Extra arguments at positions #3, #4
for
Auth.auth().signIn()
line, I do not know what I missed?
func login(email: String, password: String, name: String, surname: String) -> Future<User?, Never> {
return Future<User?, Never> { promise in
Auth.auth().signIn(withEmail: email, password: password, name: name, surname: surname) {(authResult, _) in
guard let id = authResult?.user.providerID,
let email = authResult?.user.email else {
promise(.success(nil))
return
}
let user = User(id: id, email: email, name:name, surname:surname)
promise(.success(user))
}
}
}
model:
import Foundation
struct User {
let id: String
let email: String
let name: String
let surname: String
}
In Firebase doc,
https://firebase.google.com/docs/auth/ios/email-link-auth#swift_1
the API for signIn
is:
Auth.auth().signIn(withEmail: email, link: self.link) { user, error in … }
Where did you get this API ?
Auth.auth().signIn(withEmail: email, password: password, name: name, surname: surname) {(authResult, _) in