Skip to content

docs: clarify finish_migrate_password fires on confirmed reset (AAI-884) - #298

Closed
amandazhuyilan wants to merge 1 commit into
mainfrom
aai-884-fix-migration-flag
Closed

amandazhuyilan wants to merge 1 commit into
mainfrom
aai-884-fix-migration-flag

Conversation

@amandazhuyilan

Copy link
Copy Markdown
Contributor

Summary

  • Companion PR to the aai-infrastructure fix for AAI-884: migration users were being marked "migrated" (user_needs_migration: false) before they had actually reset their password, because Auth0's password-reset-post-challenge trigger fires as soon as the reset email link is opened (e.g. by an institutional email security scanner), not once a new password is actually set.
  • The infra fix moves the flag-clear from that post-challenge action to the post-login action, gated on event.user.last_password_reset actually being set.
  • finish_migrate_password (GET /me/migration/password-changed) itself needs no functional change - it's just now called from the correct trigger point. This PR only updates its docstring, which previously described (and normalized) the buggy "starts the actual password change" semantics.

Test plan

  • Existing tests for finish_migrate_password pass unchanged (pytest tests/test_user.py -k finish_migrate_password - 5 passed)
  • Merge alongside the aai-infrastructure companion PR

🤖 Generated with Claude Code

The old docstring described the endpoint as firing when a user starts a
password change - which matched the buggy behaviour where Auth0's
password-reset-post-challenge action called it as soon as the reset
link was opened, before any password was actually changed. That trigger
is being removed (see aai-infrastructure), in favour of calling this
endpoint from the post-login action once last_password_reset confirms
the reset really happened.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant