#55 API: Accept Invitation Public Endpoint
Description
EditImplement public endpoint for accepting invitations.
Endpoint: POST /api/v1/invitations/accept
Request Body:
- invitation_token: string (required)
- password: string (required, for new users)
- name: string (optional)
Response: JWT token for the newly activated user
Implementation Requirements:
- Validate invitation token (not expired, not used)
- Create user account if new
- Assign specified role from invitation
- Mark invitation as accepted
- Return JWT token for immediate login
- Handle Google OAuth flow if preferred
- Rate limit: 5 attempts per minute per IP
Security:
- Token must be cryptographically secure
- One-time use only
- Expire after 7 days
- Log acceptance for audit
With ultra attention to details and correctness.
Before closing: write comment summarizing implementation with screenshot.
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...