Skip to content

feat: invite-acceptance page — set password to activate an invited volunteer account #958

Description

@arturasmckwcz

Why

Part of the epic: need4deed-org/be#922. Backend (need4deed-org/be#920) emails invited
volunteers a link with a token; this is the page that link lands on, where
they set a password and activate their account.

Scope

  • Depends on the SDK contract from feat: accept-invite request/response contract for volunteer account linking sdk#212 being published — pin
    need4deed-sdk to that version before starting.
  • New route, e.g. src/app/[lang]/invite/volunteer/[token]/page.tsx (or
    reuse verify-email/[token] with a role marker — decide during TODO
    review, once the backend endpoint shape from feat: invite flow — mint invite tokens for volunteers, accept-invite endpoint be#920 is
    final).
  • UI: reuse ResetPasswordForm's password + confirm-password fields and
    validation (resetPasswordSchema.ts) as a base rather than rebuilding it.
  • On submit: POST to the new accept-invite endpoint (decide during TODO
    review, once feat: invite flow — mint invite tokens for volunteers, accept-invite endpoint be#920 lands) with the
    token + password via useMutationQuery (repo convention — not a raw
    axios.post).
  • On success: call setAuthHint() and redirect to /dashboard, matching
    the existing ProfileCompletion flow for agent registration.
  • Add the new route segment to the no-redirect-on-401 allowlist in
    src/config/axios.ts (currently login, forms, register) so a stale
    or anonymous session doesn't hijack the flow mid-invite.
  • Add copy under a new translations.json namespace (mirror the
    agentRegistration namespace's shape) in both
    public/locales/en/translations.json and
    public/locales/de/translations.json.

Acceptance criteria

  • Page renders for a valid, unexpired token and lets the user set a
    password
  • Expired / invalid / already-used tokens show a clear error state (no
    silent failure)
  • On success, the user lands authenticated on /dashboard
  • New route added to axios's no-redirect allowlist
  • Copy present in both en and de locale files

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions