[PR #1492] [MERGED] [Reset Password v1] Update Temp Password #60191

Closed
opened 2026-05-11 23:20:03 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1492
Author: @vincentsalucci
Created: 8/11/2021
Status: Merged
Merged: 9/24/2021
Merged by: @vincentsalucci

Base: masterHead: m-rpv1-update-temp


📝 Commits (10+)

  • 2d2068d [Reset Password v1] Update Temp Password
  • 2879228 Merge branch 'master' into m-rpv1-update-temp
  • 4048e2c Merge branch 'master' into m-rpv1-update-temp
  • 88b9fb8 fixed order of operations for reset temp password flow
  • 391f304 Merge branch 'master' into m-rpv1-update-temp
  • 2cbb49d Merge branch 'master' into m-rpv1-update-temp
  • bad3b66 Merge branch 'master' into m-rpv1-update-temp
  • d781a9a Merge branch 'master' into m-rpv1-update-temp
  • 33d10ee Refactored bool with auth result
  • 84f6aeb Finished removal of temp password flow from set password

📊 Changes

30 files changed (+795 additions, -97 deletions)

View changed files

📝 src/App/App.xaml.cs (+1 -35)
src/App/Pages/Accounts/BaseChangePasswordViewModel.cs (+177 -0)
📝 src/App/Pages/Accounts/LoginPage.xaml.cs (+8 -0)
📝 src/App/Pages/Accounts/LoginPageViewModel.cs (+9 -11)
📝 src/App/Pages/Accounts/LoginSsoPage.xaml.cs (+8 -0)
📝 src/App/Pages/Accounts/LoginSsoPageViewModel.cs (+5 -0)
📝 src/App/Pages/Accounts/RegisterPage.xaml (+2 -2)
📝 src/App/Pages/Accounts/RegisterPageViewModel.cs (+14 -11)
📝 src/App/Pages/Accounts/SetPasswordPageViewModel.cs (+1 -1)
📝 src/App/Pages/Accounts/TwoFactorPage.xaml.cs (+8 -0)
📝 src/App/Pages/Accounts/TwoFactorPageViewModel.cs (+15 -8)
src/App/Pages/Accounts/UpdateTempPasswordPage.xaml (+160 -0)
src/App/Pages/Accounts/UpdateTempPasswordPage.xaml.cs (+83 -0)
src/App/Pages/Accounts/UpdateTempPasswordPageViewModel.cs (+90 -0)
📝 src/App/Resources/AppResources.Designer.cs (+30 -0)
📝 src/App/Resources/AppResources.resx (+15 -0)
📝 src/App/Utilities/AppHelpers.cs (+35 -0)
📝 src/Core/Abstractions/IApiService.cs (+1 -0)
📝 src/Core/Abstractions/IUserService.cs (+2 -0)
📝 src/Core/Models/Domain/AuthResult.cs (+1 -0)

...and 10 more files

📄 Description

Objective

Allow mobile client to force a password update after an admin resets a user's master password.

Code Changes

  • BaseChangePasswordViewModel: Created superclass to house methods/functionality that can be leveraged by classes needing to change/set/update a user's master password.
  • LoginPage.xaml.cs: Added functionality to handle the UpdateTempPassword flow
  • LoginPageViewModel: Added functionality to handle the UpdateTempPassword flow
  • LoginSsoPage.xaml.cs: Added functionality to handle the UpdateTempPassword flow
  • LoginSsoPageViewModel: Added functionality to handle the UpdateTempPassword flow
  • SetPasswordPage.xaml.cs: Added functionality to handle the UpdateTempPassword flow
  • SetPasswordPageViewModel: Added functionality to handle the UpdateTempPassword flow
  • TwoFactorPage.xaml.cs: Added functionality to handle the UpdateTempPassword flow
  • TwoFactorPageViewModel: Added functionality to handle the UpdateTempPassword flow
  • UpdateTempPasswordPage.xaml: Created UI to handle input of Master Password, Master password re-type, and master password hint
  • UpdateTempPasswordPage.xaml.cs: Created codebehind that handles the UpdateTempPassword flow
  • UpdateTempPasswordPageViewModel: Created view model that extends the new base class and handle logic for encrypting/setting updated password
  • AppResources: Added new strings
  • IApiService: Added new method PutUpdateTempPasswordAsync to interface
  • IUserService: Added new getter/setter methods related to the forcePasswordReset boolean
  • UpdateTempPasswordRequest: Created request model used in new API call
  • ProfileResponse: Added ForcePasswordReset to the response object
  • ApiService: Added new method PutUpdateTempPasswordAsync
  • SyncService: Called newly created setter for the ForcePasswordReset boolean
  • UserService: Created getter/setter methods for the ForcePasswordReset boolean

Screenshot

Coming Soon ™️

TODO

Determine how much of this code needs to be replicated for the iOS extensions (autofill, etc)

[MP] Support for this feature is now enabled in the extensions. A number of old extension bugs were brought to light while working on this, those have been fixed as well.

Does the UpdateTempPasswordPage need to pass in the _appOptions even though a successful update to the master password results in a log out message?

[AB] Nope, I'm being logged out as expected after resetting the password.

End to end test of existing logic/structure regarding the 4 entry points (login, sso, set password, and 2fa). Is the base class working as intended?

If the base class is working, refactor the SetPasswordPageViewModel to extend BaseChangePasswordPageViewModel


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/1492 **Author:** [@vincentsalucci](https://github.com/vincentsalucci) **Created:** 8/11/2021 **Status:** ✅ Merged **Merged:** 9/24/2021 **Merged by:** [@vincentsalucci](https://github.com/vincentsalucci) **Base:** `master` ← **Head:** `m-rpv1-update-temp` --- ### 📝 Commits (10+) - [`2d2068d`](https://github.com/bitwarden/android/commit/2d2068d5b3b8ced0b75e2dcd3e451a8d0849ced6) [Reset Password v1] Update Temp Password - [`2879228`](https://github.com/bitwarden/android/commit/28792281d69985363948089edd55eedec18efb68) Merge branch 'master' into m-rpv1-update-temp - [`4048e2c`](https://github.com/bitwarden/android/commit/4048e2c8520be73fcb8857649a2d30d9ed280e32) Merge branch 'master' into m-rpv1-update-temp - [`88b9fb8`](https://github.com/bitwarden/android/commit/88b9fb8665dcd11c8ca350218796d26f7a7f09b5) fixed order of operations for reset temp password flow - [`391f304`](https://github.com/bitwarden/android/commit/391f3046df303d926f889df08850252d9d710be1) Merge branch 'master' into m-rpv1-update-temp - [`2cbb49d`](https://github.com/bitwarden/android/commit/2cbb49deb28d5a2547aa919ca8308e5e227b2cae) Merge branch 'master' into m-rpv1-update-temp - [`bad3b66`](https://github.com/bitwarden/android/commit/bad3b6622b540775f302b0e8bafbef89da3f65a2) Merge branch 'master' into m-rpv1-update-temp - [`d781a9a`](https://github.com/bitwarden/android/commit/d781a9ac67e87ffa9c20a8ea6537b0351754150a) Merge branch 'master' into m-rpv1-update-temp - [`33d10ee`](https://github.com/bitwarden/android/commit/33d10ee5830e85dec57d6f9722a29c0b599bea18) Refactored bool with auth result - [`84f6aeb`](https://github.com/bitwarden/android/commit/84f6aeb4a2e182e7b860714c31411ae20d16ffeb) Finished removal of temp password flow from set password ### 📊 Changes **30 files changed** (+795 additions, -97 deletions) <details> <summary>View changed files</summary> 📝 `src/App/App.xaml.cs` (+1 -35) ➕ `src/App/Pages/Accounts/BaseChangePasswordViewModel.cs` (+177 -0) 📝 `src/App/Pages/Accounts/LoginPage.xaml.cs` (+8 -0) 📝 `src/App/Pages/Accounts/LoginPageViewModel.cs` (+9 -11) 📝 `src/App/Pages/Accounts/LoginSsoPage.xaml.cs` (+8 -0) 📝 `src/App/Pages/Accounts/LoginSsoPageViewModel.cs` (+5 -0) 📝 `src/App/Pages/Accounts/RegisterPage.xaml` (+2 -2) 📝 `src/App/Pages/Accounts/RegisterPageViewModel.cs` (+14 -11) 📝 `src/App/Pages/Accounts/SetPasswordPageViewModel.cs` (+1 -1) 📝 `src/App/Pages/Accounts/TwoFactorPage.xaml.cs` (+8 -0) 📝 `src/App/Pages/Accounts/TwoFactorPageViewModel.cs` (+15 -8) ➕ `src/App/Pages/Accounts/UpdateTempPasswordPage.xaml` (+160 -0) ➕ `src/App/Pages/Accounts/UpdateTempPasswordPage.xaml.cs` (+83 -0) ➕ `src/App/Pages/Accounts/UpdateTempPasswordPageViewModel.cs` (+90 -0) 📝 `src/App/Resources/AppResources.Designer.cs` (+30 -0) 📝 `src/App/Resources/AppResources.resx` (+15 -0) 📝 `src/App/Utilities/AppHelpers.cs` (+35 -0) 📝 `src/Core/Abstractions/IApiService.cs` (+1 -0) 📝 `src/Core/Abstractions/IUserService.cs` (+2 -0) 📝 `src/Core/Models/Domain/AuthResult.cs` (+1 -0) _...and 10 more files_ </details> ### 📄 Description ## Objective > Allow mobile client to force a password update after an admin resets a user's master password. ## Code Changes - **BaseChangePasswordViewModel**: Created superclass to house methods/functionality that can be leveraged by classes needing to change/set/update a user's master password. - **LoginPage.xaml.cs**: Added functionality to handle the `UpdateTempPassword` flow - **LoginPageViewModel**: Added functionality to handle the `UpdateTempPassword` flow - **LoginSsoPage.xaml.cs**: Added functionality to handle the `UpdateTempPassword` flow - **LoginSsoPageViewModel**: Added functionality to handle the `UpdateTempPassword` flow - **SetPasswordPage.xaml.cs**: Added functionality to handle the `UpdateTempPassword` flow - **SetPasswordPageViewModel**: Added functionality to handle the `UpdateTempPassword` flow - **TwoFactorPage.xaml.cs**: Added functionality to handle the `UpdateTempPassword` flow - **TwoFactorPageViewModel**: Added functionality to handle the `UpdateTempPassword` flow - **UpdateTempPasswordPage.xaml**: Created UI to handle input of Master Password, Master password re-type, and master password hint - **UpdateTempPasswordPage.xaml.cs**: Created codebehind that handles the `UpdateTempPassword` flow - **UpdateTempPasswordPageViewModel**: Created view model that extends the new base class and handle logic for encrypting/setting updated password - **AppResources**: Added new strings - **IApiService**: Added new method `PutUpdateTempPasswordAsync` to interface - **IUserService**: Added new getter/setter methods related to the `forcePasswordReset` boolean - **UpdateTempPasswordRequest**: Created request model used in new API call - **ProfileResponse**: Added `ForcePasswordReset` to the response object - **ApiService**: Added new method `PutUpdateTempPasswordAsync` - **SyncService**: Called newly created setter for the `ForcePasswordReset` boolean - **UserService**: Created getter/setter methods for the `ForcePasswordReset` boolean - **** ## Screenshot Coming Soon ™️ ## TODO > Determine how much of this code needs to be replicated for the iOS extensions (autofill, etc) [MP] Support for this feature is now enabled in the extensions. A number of old extension bugs were brought to light while working on this, those have been fixed as well. > Does the `UpdateTempPasswordPage` need to pass in the `_appOptions` even though a successful update to the master password results in a `log out` message? [AB] Nope, I'm being logged out as expected after resetting the password. > End to end test of existing logic/structure regarding the 4 entry points (login, sso, set password, and 2fa). Is the base class working as intended? > If the base class is working, refactor the `SetPasswordPageViewModel` to extend `BaseChangePasswordPageViewModel` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-11 23:20:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#60191