Skip to main content

Function: acceptInvitation()

acceptInvitation(_prev, formData): Promise<AcceptState>

Defined in: src/server/actions/contractor-auth.ts:26

Public action: a contractor accepts their invitation by setting a password. Validates the single-use token (by hash), creates their Supabase auth user, links it to the contractor row, marks the invitation accepted, signs them in, and redirects to the contractor home.

Parameters

_prev

AcceptState

formData

FormData

Returns

Promise<AcceptState>