Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add password update option #12635

Merged
merged 60 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
2964dfe
Add PhoneAuth details in Settings view
pragatimodi Jan 29, 2024
c594c19
undo SwiftApplication.plist changes
pragatimodi Jan 29, 2024
354a6ef
undo SwiftApplication.plist changes
pragatimodi Jan 29, 2024
3ab2ac8
undo SwiftApplication.plist changes
pragatimodi Jan 29, 2024
ae27388
clang formatting
pragatimodi Jan 29, 2024
e057b17
game center auth login
pragatimodi Feb 6, 2024
b38a988
lint
pragatimodi Feb 6, 2024
c4d8943
correct method name
pragatimodi Feb 6, 2024
121c656
add game center icon
pragatimodi Feb 6, 2024
e6b298f
add game center account linking
pragatimodi Feb 6, 2024
46e2b62
Merge branch 'game-center' of https://github.com/firebase/firebase-io…
pragatimodi Feb 6, 2024
417168b
lint
pragatimodi Feb 6, 2024
660551c
add app-section
pragatimodi Feb 23, 2024
c704b1a
undo accidental changes
pragatimodi Feb 23, 2024
22272f2
lint fixes
pragatimodi Feb 23, 2024
dd5d5a9
add game center to AuthMenu
pragatimodi Feb 23, 2024
297cb2f
add OOB section
pragatimodi Feb 23, 2024
cd79c97
add verifyClient() method
pragatimodi Feb 24, 2024
63ee2ab
Merge branch 'app-section' of https://github.com/firebase/firebase-io…
pragatimodi Feb 24, 2024
70d6b8d
add oob methods
pragatimodi Feb 28, 2024
4716a45
add oob section methods and Section modifiers
pragatimodi Feb 29, 2024
d8467e4
change ordering
pragatimodi Feb 29, 2024
a071a7c
add mfa section
pragatimodi Mar 4, 2024
d06a7a4
add error prompts
pragatimodi Mar 5, 2024
7bf243d
fix .plist line deletion
pragatimodi Mar 12, 2024
9b5639c
fix unit test
pragatimodi Mar 12, 2024
4f8fbb4
Merge branch 'auth-swift' of https://github.com/firebase/firebase-ios…
pragatimodi Mar 18, 2024
0471e5d
Merge branch 'auth-swift' of https://github.com/firebase/firebase-ios…
pragatimodi Mar 18, 2024
72d213d
Merge branch 'settings-phoneauth' of https://github.com/firebase/fire…
pragatimodi Mar 18, 2024
988cf5e
add password update option
pragatimodi Mar 27, 2024
50d308a
Merge branch 'auth-swift' of https://github.com/firebase/firebase-ios…
pragatimodi Apr 3, 2024
ffcee37
Merge branch 'game-center' of https://github.com/firebase/firebase-io…
pragatimodi Apr 3, 2024
db885d7
style.sh changes
pragatimodi Apr 3, 2024
19b6c57
remove authMenu test
pragatimodi Apr 4, 2024
b55b1f1
style
pragatimodi Apr 4, 2024
7235386
comment out AuthMenu UI test
pragatimodi Apr 4, 2024
1c331eb
cleanup
pragatimodi Apr 4, 2024
8171aca
Merge branch 'game-center' of https://github.com/firebase/firebase-io…
pragatimodi Apr 4, 2024
d736fcb
Merge branch 'app-section' of https://github.com/firebase/firebase-io…
pragatimodi Apr 4, 2024
9645371
Merge branch 'oob-section' of https://github.com/firebase/firebase-io…
pragatimodi Apr 4, 2024
8d2b89e
remove redundant comment
pragatimodi Apr 4, 2024
bd47b2a
oob section changes
pragatimodi Apr 9, 2024
23e7899
lint
pragatimodi Apr 9, 2024
22358a2
undo whitespace changes
pragatimodi Apr 9, 2024
6589e57
Merge branch 'oob-section' of https://github.com/firebase/firebase-io…
pragatimodi Apr 9, 2024
c2330a6
Merge branch 'mfa-section' of https://github.com/firebase/firebase-io…
pragatimodi Apr 9, 2024
fb323ae
fix bracket
pragatimodi Apr 10, 2024
a8abe96
Merge branch 'oob-section' of https://github.com/firebase/firebase-io…
pragatimodi Apr 10, 2024
f5d8b4f
lint
pragatimodi Apr 10, 2024
71b623c
Merge branches 'mfa-section' and 'oob-section' of https://github.com/…
pragatimodi Apr 10, 2024
3f7d7fb
lint
pragatimodi Apr 10, 2024
3dbe059
fix duplicate declarations due to merge
pragatimodi Apr 10, 2024
72c9c89
apply code review suggestions
pragatimodi Apr 10, 2024
32b4fcb
Merge branch 'mfa-section' of https://github.com/firebase/firebase-io…
pragatimodi Apr 10, 2024
ec2bc82
lint
pragatimodi Apr 10, 2024
683dd80
fix auth menu items
pragatimodi Apr 15, 2024
349a6c4
Merge branch 'mfa-section' of https://github.com/firebase/firebase-io…
pragatimodi Apr 15, 2024
d68c8dd
Merge branch 'auth-swift' of https://github.com/firebase/firebase-ios…
pragatimodi May 6, 2024
c7ad235
update settings controller changes
pragatimodi May 6, 2024
afc5609
lint
pragatimodi May 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ enum UserAction: String {
case updateDisplayName = "Display Name"
case updatePhoneNumber = "Phone Number"
case refreshUserInfo = "Refresh User Info"
case updatePassword = "Update Password"
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ extension User: DataSourceProvidable {
Item(title: UserAction.signOut.rawValue, textColor: .systemBlue),
Item(title: UserAction.link.rawValue, textColor: .systemBlue, hasNestedContent: true),
Item(title: UserAction.requestVerifyEmail.rawValue, textColor: .systemBlue),
Item(title: UserAction.updatePassword.rawValue, textColor: .systemBlue),
Item(title: UserAction.tokenRefresh.rawValue, textColor: .systemBlue),
Item(title: UserAction.delete.rawValue, textColor: .systemRed),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ class UserViewController: UIViewController, DataSourceProviderDelegate {
case .updateEmail:
presentEditUserInfoController(for: actionName, to: updateUserEmail)

case .updatePassword:
presentEditUserInfoController(for: actionName, to: updatePassword)

case .updateDisplayName:
presentEditUserInfoController(for: actionName, to: updateUserDisplayName)

Expand Down Expand Up @@ -165,6 +168,19 @@ class UserViewController: UIViewController, DataSourceProviderDelegate {
})
}

public func updatePassword(to newPassword: String) {
user?.updatePassword(to: newPassword, completion: {
error in
if let error = error {
print("Update password failed. \(error)", error)
return
} else {
print("Password updated!")
}
self.updateUI()
})
}

public func updatePhotoURL(to newPhotoURL: String) {
guard let newPhotoURL = URL(string: newPhotoURL) else {
print("Could not create new photo URL!")
Expand Down
Loading