Skip to content

feat(auth): Add show/hide password toggle to sign-in page - #124252

Open
parh0m2007 wants to merge 2 commits into
getsentry:masterfrom
parh0m2007:feat/login-password-visibility-toggle
Open

parh0m2007 wants to merge 2 commits into
getsentry:masterfrom
parh0m2007:feat/login-password-visibility-toggle

Conversation

@parh0m2007

Copy link
Copy Markdown

Summary

Adds an eye button inside the password field of the Django-rendered sign-in page that lets users toggle between the masked and visible password. Fixes #79692.

The React authV2 email login (static/app/views/authV2/authLogin/components/emailAuth.tsx) already ships a show/hide password toggle; this brings the legacy server-rendered sentry/login.html template to parity for users who don't have the React auth experiment cookie enabled.

Implementation

  • The login form loop in sentry/login.html wraps each field in a login-form-field container; for the password field it also renders a password-visibility-toggle button using the existing eye glyph (\e60d) from the sentry-simple icon font (no new assets needed).
  • Inline vanilla JS binds click handlers that flip the input type between password and text and update aria-pressed / aria-label (Show password / Hide password) for screen readers. Idempotent binding via data-bound so it is safe with the tab-switching on the page.
  • The password PasswordInput widget gains a password-input class used for padding-right so text doesn't run under the button.
  • LESS styles live under the existing body.auth block in static/less/layout.less; the .icon-eye glyph class is added to static/less/fonts.less alongside the other Django-view icons.

Tests

  • test_login_page_includes_password_visibility_toggle asserts the toggle markup (login-form-field password-field, password-visibility-toggle, aria-label) and the client-side binder are present on the rendered login page.

Add an eye button inside the password field on the Django-rendered
sign-in page that toggles between masked and visible password.

- Wrap the password field in a relative container and render a
  password-visibility-toggle button (uses the existing `eye` glyph
  from the sentry-simple icon font)
- Vanilla JS toggles the input type and updates aria-pressed and
  aria-label for accessibility
- The React authV2 email login already ships this toggle; this
  brings the legacy template to parity
@parh0m2007
parh0m2007 requested review from a team as code owners September 13, 2026 13:06
@github-actions github-actions Bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Sep 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

Comment thread src/sentry/templates/sentry/login.html Outdated

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e211c14. Configure here.

Comment thread src/sentry/templates/sentry/login.html Outdated
After clicking to reveal, the toggle reported aria-pressed=false;
after hiding it reported true. aria-pressed should signal that the
password is visible, which is the pre-toggle hidden state, so bind
it to isHidden directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add show/hide feature for password with a eye button at sign-in page

1 participant