Skip to content

[6.x] Autopopulate email on password reset form#14834

Merged
jasonvarga merged 3 commits into
6.xfrom
autopopulate-new-user-email
Jun 17, 2026
Merged

[6.x] Autopopulate email on password reset form#14834
jasonvarga merged 3 commits into
6.xfrom
autopopulate-new-user-email

Conversation

@jackmcdade

Copy link
Copy Markdown
Member

Checks the email attached to the token and autopopulates the field. Went with this method instead of a GET param so the email address doesn't get passed around in URLs/logs etc.

jackmcdade and others added 3 commits June 17, 2026 09:57
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bounds the per-request token lookup so the reset form GET routes can't be
flooded. Adds a dedicated limiter separate from the auth throttle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jasonvarga

Copy link
Copy Markdown
Member

Pushed a couple things:

Focus fix — the read-only email field was still grabbing autofocus, so on load it looked editable even though it wasn't (read-only styling only shows when it's not focused). Moved focus to the password field when the email's locked.

ThrottlingfindEmailByToken does a bcrypt check per pending reset on every page load, and these GET routes weren't throttled, so they could get hammered. Added a dedicated statamic.password-reset-form limiter (15/min/IP + a statamic.cp.* variant) on the three form routes. Didn't reuse statamic.auth for this — it's only 4/min and shared with login/forgot/reset, so counting page views against it would eat the auth budget and 429 you out of the form.

@jasonvarga jasonvarga changed the title [6.x] Autopopulate New User Email [6.x] Autopopulate email on password reset form Jun 17, 2026
@jasonvarga jasonvarga merged commit bba2526 into 6.x Jun 17, 2026
22 checks passed
@jasonvarga jasonvarga deleted the autopopulate-new-user-email branch June 17, 2026 19:18
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.

2 participants