Add a 'Back to login' link to the password pages (#9301)#10037
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThis PR implements a navigation feature for password recovery pages. Templates for the Forgot Password and Reset Password flows now pass a ChangesBack to Login Navigation Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
e6ad4c3 to
3d2b11a
Compare
The Forgot Password and Reset Password pages had no way to navigate back to the login page. Added a "Back to login" link (using the login URL already used by the login form) to both pages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3d2b11a to
2e364e7
Compare
There was a problem hiding this comment.
Pull request overview
Adds a user-visible navigation path back to the login page from the “Forgot Password” and “Reset Password” security pages, addressing #9301 and aligning with the existing login endpoint usage.
Changes:
- Render a conditional Back to login link on Forgot/Reset password React pages when
loginUrlis provided. - Pass
loginUrlfrom the corresponding Jinja templates usingurl_for('authenticate.login'). - Document the change in the v9.16 release notes.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| web/pgadmin/templates/security/reset_password.html | Adds loginUrl to props passed into the reset password page. |
| web/pgadmin/templates/security/forgot_password.html | Adds loginUrl to props passed into the forgot password page. |
| web/pgadmin/static/js/SecurityPages/PasswordResetPage.jsx | Renders a centered “Back to login” anchor when loginUrl is present; updates propTypes. |
| web/pgadmin/static/js/SecurityPages/ForgotPasswordPage.jsx | Renders a centered “Back to login” anchor when loginUrl is present; updates propTypes. |
| docs/en_US/release_notes_9_16.rst | Adds a v9.16 release note entry for #9301. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
asheshv
left a comment
There was a problem hiding this comment.
LGTM. url_for('authenticate.login') (not a query-string redirect) means no open-redirect risk, link sits outside the form so no CSRF or layout impact, and gettext() is correctly applied.
One judgment-call note (non-blocking, the issue scope was password pages): MfaRegisterPage and MfaValidatePage are registered in the same SecurityPages/index.jsx map and don't get the link. If a user gets stuck mid-MFA they have no obvious way back — worth a quick decision on whether that's in scope here or a follow-up.
Catalog regen will be needed in a separate commit, as the description notes.
Summary
Fixes #9301.
The Forgot Password and Reset Password pages offered no way to navigate back to the login page. This adds a Back to login link to both pages, using the same login URL the login form already posts to.
Changes
ForgotPasswordPage.jsx/PasswordResetPage.jsx: render a "Back to login" link when aloginUrlis provided.forgot_password.html/reset_password.html: passloginUrl(url_for('authenticate.login')) in the page props.🤖 Generated with Claude Code
Summary by CodeRabbit