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

feat(#9547): require password reset on first time login and admin password update #9731

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

Benmuiruri
Copy link
Contributor

@Benmuiruri Benmuiruri commented Jan 8, 2025

Description

Video showing password reset in action
Screen.Recording.2025-01-10.at.10.29.17.mov
Video showing permission enabling skipping password reset
Screen.Recording.2025-01-10.at.10.32.14.mov
Video showing api supports setting password_change_required: false for specific user
Screen.Recording.2025-01-10.at.10.44.23.mov
Video showing password change hint in admin app
Screen.Recording.2025-01-15.at.15.01.17.mov

Closes #9547

Code review checklist

  • UI/UX backwards compatible: Test it works for the new design (enabled by default). And test it works in the old design, enable can_view_old_navigation permission to see the old design.
  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or e2e where appropriate
  • Internationalised: All user facing text
  • Backwards compatible: Works with existing data and configuration or includes a migration. Any breaking changes documented in the release notes.

Compose URLs

If Build CI hasn't passed, these may 404:

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@Benmuiruri Benmuiruri changed the title feat(#9547): add password change feature on first time login feat(#9547): require password reset on first time login and admin password update Jan 8, 2025
@Benmuiruri Benmuiruri mentioned this pull request Jan 8, 2025
5 tasks
@Benmuiruri Benmuiruri marked this pull request as ready for review January 10, 2025 07:49
@Benmuiruri Benmuiruri requested a review from jkuester January 10, 2025 10:30
@Benmuiruri
Copy link
Contributor Author

Hi @jkuester I resolved the feedback you gave me and this implementation is leaner than the previous one. It is now ready for review.

Copy link
Contributor

@jkuester jkuester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is coming together nicely! Couple additional comments/suggestions here.

I think my only remaining workflow-level question is if you think we need some kind of message in the admin app when changing a user's password that will alert the admin that the user will be prompted to change their password again? I am just concernd that we will still catch folks off guard with this functionality change... 🤔

shared-libs/user-management/src/users.js Outdated Show resolved Hide resolved
shared-libs/user-management/src/users.js Outdated Show resolved Hide resolved
shared-libs/user-management/src/users.js Outdated Show resolved Hide resolved
shared-libs/user-management/src/users.js Outdated Show resolved Hide resolved
api/tests/mocha/controllers/login.spec.js Outdated Show resolved Hide resolved
webapp/tests/mocha/unit/bootstrapper.spec.js Show resolved Hide resolved
tests/integration/api/controllers/users.spec.js Outdated Show resolved Hide resolved
@Benmuiruri
Copy link
Contributor Author

Hi @jkuester Good point about adding a sort of warning. I came up with this

update.password.help = User will be prompted to reset password after login unless can_skip_password_change permission is enabled for the user role.
Screenshot 2025-01-14 at 19 21 46

@jkuester
Copy link
Contributor

@Benmuiruri Yes, that was exactly what I was thinking. Would it be possible to just hide it for users that have the can_skip_password_change permission? I would rather not mention the permission at all in the message and it seems it would be most helpful to just see it in the case where we know a password reset will be necessary. But, I am not sure if we have everything we need in context here to know which permissions the user is going to have...

@Benmuiruri Benmuiruri requested a review from jkuester January 15, 2025 12:31
Copy link
Contributor

@jkuester jkuester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic! I had one minor suggestion about the update user code, but otherwise this is good to go!

admin/src/js/controllers/edit-user.js Show resolved Hide resolved
shared-libs/user-management/src/users.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change password on first login
5 participants