Repository navigation
Conversation
…ccepted A pending invitation was validated only when it was sent. If the sender was later demoted, removed from the team, or deleted their account, the invite still admitted its recipient with the stored roles for up to seven days. With Owner invites in the client (VoltiusApp/voltius#778) that let a former Owner mint a new one. Every acceptance path (link token, in-app invite, registration auto-accept) now re-runs the send-time checks against the stored sender: invite permission plus authority over each role still present. A failed check answers 410 Gone. A resend from a current admin stores them as the sender and revives the invite. The duplicated invite-permission guard in add_member and invite_member is now one helper. Test invitations carry the team owner as sender.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of VoltiusApp/voltius#778 (invite directly as Owner).
A pending invitation was only validated when sent. If the sender was later demoted, removed, or deleted their account, it still admitted the recipient with the stored roles for up to 7 days. With Owner invites in the client, a former Owner could mint a new Owner that way.
accept_pending_invitation, which now re-runs the send-time checks againstinvited_by: invite permission plus authority over each role still present. Roles deleted since are skipped, asadmit_memberalready does.410 Gone. A resend by a current admin stores them as sender and revives the invite.add_member/invite_membershare onerequire_can_inviteguard.seed_invitationnow records the team owner as sender;seed_invitation_fromtakes an explicit one.No migration. Rollback to sha-e649ce5 is safe.
Tests: 5 new in
inviter_recheck_tests; full suite 952/952 against Postgres 17.