feat: add password reset for default admin/user accounts#1457
feat: add password reset for default admin/user accounts#1457jescalada wants to merge 7 commits intofinos:mainfrom
Conversation
✅ Deploy Preview for endearing-brigadeiros-63f9d0 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1457 +/- ##
==========================================
+ Coverage 89.66% 89.88% +0.21%
==========================================
Files 68 69 +1
Lines 4869 5011 +142
Branches 888 922 +34
==========================================
+ Hits 4366 4504 +138
- Misses 485 488 +3
- Partials 18 19 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dcoric
left a comment
There was a problem hiding this comment.
The overall approach is solid. I spotted a few small things worth addressing
Removing this as testing is more trouble than it's worth (app is internal, /change-password only works with local auth and only used on first login)
|
@dcoric I've experimented with session regeneration/logging out after resetting password, but both of these seem to cause trouble due to differences between unit test vs E2E vs production. I made another PR for debugging the failing tests #1463 but couldn't find a setup that works as intended. I believe there's no real risk of session-based attacks (orgs implementing GitProxy use OIDC/AD instead of local auth, plus password resetting is only used in the initial setup), so I've decided to skip the session refreshing. |
It is an extreme edge case. I think we are safe to proceed. If required we can always return to this in the future in a separated issue. |
Fixes #1022.
I opted for the password reset solution instead of relying on the config, since I didn't want to cause any extra confusion for new users (GitProxy administrators) or friction for testing/development which relies on these dummy accounts.
The bulk of the changes are test files and frontend additions/refactoring.
I also added tests to improve coverage for auth routes.
Disclaimer: This PR was created with agentic AI and refactored manually to improve code quality. I validated the password reset flow manually and with Cypress tests. Please keep this in mind during review - there may be some obvious mistakes I missed!
Screenshot
Shown automatically when logging in with admin/admin for the first time, and when trying to navigate to other pages. Note that this is only visible when
NODE_ENVis set to production.