Skip to content

Add a 'Back to login' link to the password pages (#9301)#10037

Merged
asheshv merged 2 commits into
pgadmin-org:masterfrom
dpage:fix-9301-back-to-login
Jun 12, 2026
Merged

Add a 'Back to login' link to the password pages (#9301)#10037
asheshv merged 2 commits into
pgadmin-org:masterfrom
dpage:fix-9301-back-to-login

Conversation

@dpage

@dpage dpage commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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 a loginUrl is provided.
  • forgot_password.html / reset_password.html: pass loginUrl (url_for('authenticate.login')) in the page props.
  • Added release note (9.16).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a "Back to login" link to the Forgot Password and Reset Password pages for convenient navigation back to the login screen.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f64d8166-cda0-495b-9174-44e2e999f2fc

📥 Commits

Reviewing files that changed from the base of the PR and between 8f03453 and fcf831f.

📒 Files selected for processing (1)
  • docs/en_US/release_notes_9_16.rst
✅ Files skipped from review due to trivial changes (1)
  • docs/en_US/release_notes_9_16.rst

Walkthrough

This PR implements a navigation feature for password recovery pages. Templates for the Forgot Password and Reset Password flows now pass a loginUrl prop to React components. Both ForgotPasswordPage and PasswordResetPage components conditionally render a "Back to login" link when the URL is provided. The feature is documented in v9.16 release notes.

Changes

Back to Login Navigation Feature

Layer / File(s) Summary
Templates: Passing loginUrl to Components
web/pgadmin/templates/security/forgot_password.html, web/pgadmin/templates/security/reset_password.html
Forgot Password and Reset Password templates extend page_props to include loginUrl derived from the login route, providing the data needed for the React components to render back-to-login navigation.
React Components: Rendering Back to Login Links
web/pgadmin/static/js/SecurityPages/ForgotPasswordPage.jsx, web/pgadmin/static/js/SecurityPages/PasswordResetPage.jsx
Both components import MUI Box, accept loginUrl in their function signatures, add loginUrl to propTypes as an optional string, and conditionally render a centered "Back to login" anchor link when loginUrl is provided.
Release Notes Documentation for v9.16
docs/en_US/release_notes_9_16.rst
Added release notes entry documenting issue #9301 and the new "Back to login" feature for password recovery pages.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add a 'Back to login' link to the password pages (#9301)' clearly and concisely summarizes the main change: adding a navigation link to password pages.
Linked Issues check ✅ Passed The code changes fully implement the requirements from issue #9301: adding a 'Back to login' link to Forgot Password and Reset Password pages with proper UI integration.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the 'Back to login' link feature; no unrelated modifications are present in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dpage dpage force-pushed the fix-9301-back-to-login branch 2 times, most recently from e6ad4c3 to 3d2b11a Compare June 9, 2026 11:36
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 loginUrl is provided.
  • Pass loginUrl from the corresponding Jinja templates using url_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 asheshv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@asheshv asheshv merged commit c33927f into pgadmin-org:master Jun 12, 2026
34 checks passed
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.

Option missiong on the reset password to navigate to another page

3 participants