Service Layer medium complexity backend
1
Dependencies
1
Dependents
3
Entities
0
Integrations

Description

Focused service handling the invitation token lifecycle: generation, storage, validation, and expiry. Generates cryptographically secure single-use tokens, persists them with TTL, and resolves them on acceptance to complete account activation.

Feature: User CRUD

user-invitation-service

Responsibilities

  • Generate single-use cryptographically secure invite tokens with 72-hour TTL
  • Validate and consume tokens on invitation acceptance
  • Expire and clean up stale tokens

Interfaces

createInviteToken(email: string, orgId: string, roleId: string): Promise<string>
validateAndConsumeToken(token: string): Promise<InviteTokenPayload>
revokeToken(token: string): Promise<void>
cleanExpiredTokens(): Promise<number>

Relationships

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (3)

Data entities managed by this component