Fix password reset flow (#1) #27

Merged
westfarn merged 4 commits from feature/password-reset-1 into master 2026-07-27 05:07:42 -07:00
Owner

Summary

  • Closes Allow for password reset (#1)
  • Replace broken csrf_exempt reset_password FBV (responses never returned; missing requests import) with working DRF ResetUserPassword
  • Deduplicate reset email helper; build set-password links from FRONTEND_BASE_URL
  • Harden SetUserPassword: require unusable password, min 8 chars, handle missing slug
  • Accept reCAPTCHA v2 (success only) and v3 (score ≥ 0.5); avoid email enumeration (200 after valid captcha)
  • Add unit tests for reset + set-password edge cases

Test plan

  • manage.py test chat_backend.tests.test_views_users.ResetPasswordTestCase chat_backend.tests.test_views_users.SetPasswordTestCase
  • With SMTP configured: request reset for known email → receive link → set password → sign in
  • Unknown email still returns 200 and sends no mail
  • Failed captcha returns 400
  • Pair with chat_web_app feature/password-reset-1 PR
## Summary - Closes #1 - Replace broken `csrf_exempt` `reset_password` FBV (responses never returned; missing `requests` import) with working DRF `ResetUserPassword` - Deduplicate reset email helper; build set-password links from `FRONTEND_BASE_URL` - Harden `SetUserPassword`: require unusable password, min 8 chars, handle missing slug - Accept reCAPTCHA v2 (success only) and v3 (score ≥ 0.5); avoid email enumeration (200 after valid captcha) - Add unit tests for reset + set-password edge cases ## Test plan - [ ] `manage.py test chat_backend.tests.test_views_users.ResetPasswordTestCase chat_backend.tests.test_views_users.SetPasswordTestCase` - [ ] With SMTP configured: request reset for known email → receive link → set password → sign in - [ ] Unknown email still returns 200 and sends no mail - [ ] Failed captcha returns 400 - [ ] Pair with chat_web_app `feature/password-reset-1` PR
westfarn added 1 commit 2026-07-27 04:27:10 -07:00
Fix password reset flow so forgot-password emails work (#1)
CI / test (pull_request) Successful in 10s
Unit Tests / test (pull_request) Successful in 9s
199c57f1d6
Replace the broken csrf_exempt handler (responses never returned) with a
working DRF endpoint, use FRONTEND_BASE_URL for reset links, and harden
set-password against reuse and short passwords.
westfarn added 1 commit 2026-07-27 04:39:37 -07:00
Brand emails as Hesychia and audit password reset/set events
CI / test (pull_request) Failing after 10s
Unit Tests / test (pull_request) Failing after 9s
6a985a2477
Restyle invite/reset/feedback mail to match the app glass UI, queue sends
via Django 6 Tasks (ImmediateBackend for now), and show timestamped auth
events on the user admin detail page.
westfarn added 1 commit 2026-07-27 04:42:00 -07:00
Track outbound emails in admin with send status
CI / test (pull_request) Failing after 9s
Unit Tests / test (pull_request) Failing after 9s
9412dc3efc
Persist OutboundEmail rows (queued/sending/sent/failed) for invite, reset,
and feedback mail, show them on user detail + a dedicated admin list, and
stamp X-Hesychia-Email-Id for a future SMTP2GO webhook (#28).
westfarn added 1 commit 2026-07-27 04:43:46 -07:00
Fix feedback email test for on_commit task enqueue
CI / test (pull_request) Successful in 10s
Unit Tests / test (pull_request) Successful in 10s
c3e29d3e72
Execute on_commit callbacks so OutboundEmail ImmediateBackend send runs
inside TestCase transactions, matching invite/reset coverage.
westfarn merged commit 16442b336c into master 2026-07-27 05:07:42 -07:00
westfarn deleted branch feature/password-reset-1 2026-07-27 05:07:43 -07:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ai_ml_operations/chat_backend#27