Closed TaeJoongYoon closed 5 years ago
Oh, I'm sorry.
In updateEmail and delete,
Must replace let auth = Auth.auth()
with let auth = Auth.auth().currentUser?
Absolutely, delete and updateEmail are a reactive User extension, not an Auth extension
You're right.
Then can I split them?
What do you mean ? @TaeJoongYoon
Create:
let auth = Auth.auth()
// Create a password-based account
auth.rx.createUser(withEmail: "xxx@xxx.com", password: "1q2w3e4r")
.subscribe(onNext: { authResult in
// User signed in
}, onError: { error in
// Uh-oh, an error occurred!
}).disposed(by: disposeBag)
// https://firebase.google.com/docs/auth/ios/password-auth
Sign In:
let auth = Auth.auth()
// Sign in a user with an email address and password
auth.rx.signIn(withEmail: "xxx@xxx.com", password: "1q2w3e4r")
.subscribe(onNext: { authResult in
// User signed in
}, onError: { error in
// Uh-oh, an error occurred!
}).disposed(by: disposeBag)
// https://firebase.google.com/docs/auth/ios/password-auth
Update Email:
let auth = Auth.auth().currentUser?
// Set a user's email address
auth.rx.updateEmail(to: "xxx@xxx.com")
.subscribe(onNext: {
// Completed updating Email
}, onError: { error in
// Uh-oh, an error occurred!
}).disposed(by: disposeBag)
// https://firebase.google.com/docs/auth/ios/manage-users
Delete:
let auth = Auth.auth().currentUser?
// Delete a user
auth.rx.delete()
.subscribe(onNext: {
// User deleted
}, onError: { error in
// Uh-oh, an error occurred!
}).disposed(by: disposeBag)
// https://firebase.google.com/docs/auth/ios/manage-users
I mean like this.
Yes ! maybe replace the wording "auth" with "user" for email address & delete overwise it's perfect
Yes :) I edit it.
you have to replace auth.rx.updateEmail => user.rx.updateEmail and auth.rx.delete() => user.rx.delete()
I'm so sorry... I replace them
perfect! thx for your help :)
Add examples to README about Auth