Skip to content

feat(organizations): add invitations with 7-day expiry and accept flow - #466

Merged
EmmanuelOchaje merged 1 commit into
StellarTickets:mainfrom
Salamanda-Hub:feat/organization-invitations
Oct 18, 2026
Merged

EmmanuelOchaje merged 1 commit into
StellarTickets:mainfrom
Salamanda-Hub:feat/organization-invitations

Conversation

@Akatenvictor

Copy link
Copy Markdown
Contributor

Members could only be added if the user already existed. An OWNER/ADMIN can now invite an email address via POST /organizations/:id/invitations (role ADMIN or STAFF, default STAFF). The raw token is returned once; only its SHA-256 hash is stored.

POST /organizations/invitations/accept lets the signed-in user whose email matches the invite accept it: this creates the OrganizationMember with the invited role and promotes an ATTENDEE to ORGANIZER, in one transaction. Invites expire 7 days after creation and return 410 once expired. Unknown tokens or soft-deleted orgs return 404, a mismatched email 403, and a reused invite or existing membership 409.

Includes the OrganizationInvitation migration.

Summary

Testing

  • npx tsc --noEmit passes
  • npx eslint "src/**/*.ts" passes
  • npm test passes
  • npm run build succeeds

Closes #71
Closes #69
Closes #87
Closes #85

Members could only be added if the user already existed. An OWNER/ADMIN can
now invite an email address via POST /organizations/:id/invitations (role
ADMIN or STAFF, default STAFF). The raw token is returned once; only its
SHA-256 hash is stored.

POST /organizations/invitations/accept lets the signed-in user whose email
matches the invite accept it: this creates the OrganizationMember with the
invited role and promotes an ATTENDEE to ORGANIZER, in one transaction.
Invites expire 7 days after creation and return 410 once expired. Unknown
tokens or soft-deleted orgs return 404, a mismatched email 403, and a
reused invite or existing membership 409.

Includes the OrganizationInvitation migration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@Akatenvictor Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@netlify

netlify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for stellarticketsbackend ready!

Name Link
🔨 Latest commit 5afbd34
🔍 Latest deploy log https://app.netlify.com/projects/stellarticketsbackend/deploys/6ad4a7e9939b11f8da317a2b
😎 Deploy Preview https://deploy-preview-466--stellarticketsbackend.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@EmmanuelOchaje
EmmanuelOchaje merged commit 19990c5 into StellarTickets:main Oct 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants