Skip to content

fix(users): validate an invite password before accepting the invitation (#763) - #797

Merged
antosubash merged 6 commits into
mainfrom
feat/b48-users-invite-atomic
Nov 3, 2026
Merged

antosubash merged 6 commits into
mainfrom
feat/b48-users-invite-atomic

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

  • accept_invite used to call fastapi-users verify before setting the password. The adapter commits verify, so a password that failed validation consumed the invitation, and the corrected retry got INVITE_BAD_TOKEN.
  • The new users.invites.accept.complete_invite:
    • runs verify's token checks (identical to fastapi-users 15.0.5) without its write;
    • validates the password first;
    • then writes is_verified, hashed_password and an optional full_name in one user_db.update.
  • on_after_verify then on_after_update still fire; both are no-ops in this repo today. Error contracts are unchanged.
  • Tests read durable state from a fresh session after a rejected password, then retry successfully. They also check that a rejection fires no hooks.
  • Docs and CHANGELOG are updated.

Closes #763

Review

/ship pipeline: correctness and maintainability review (Sonnet), triage.

  • Fixed:
    • moved the helper next to the other invite code (users/invites/accept.py);
    • restored the blank-full_name comment;
    • removed a duplicate replay test;
    • noted the hook timing in the CHANGELOG.
  • Rejected, both pre-existing behaviour unchanged by this PR:
    • the concurrent-accept race;
    • a hook failure after commit.

Verification

  • make lint: passes.
  • make test-py: 7247 passed. The one local failure is the known /tmp/.git sandbox placeholder.

https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: d88df5d
Status: ✅  Deploy successful!
Preview URL: https://8baf32dc.simple-module-python.pages.dev
Branch Preview URL: https://feat-b48-users-invite-atomic.simple-module-python.pages.dev

View logs

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-03T18:03:16.957733Z 56544d7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@antosubash
antosubash merged commit 032eb0f into main Nov 3, 2026
17 checks passed
@antosubash
antosubash deleted the feat/b48-users-invite-atomic branch November 3, 2026 18:22
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.

[P2] users: rejected invite password consumes the invitation

1 participant