Description
Continuation of #954 / #955 (volunteer self-registration). Once a volunteer confirms their email, they currently land nowhere meaningful, this issue adds the missing step: a "volunteer profile" form, pre-filled with the account details they already entered (name, email, phone) and empty for everything else, that opens right after they click the confirmation link in their email.
This mirrors the existing agent flow exactly:
verify-email/[token]/page.tsx already branches on the registering role: after verifying, an "agent" is sent to /register/agent/complete?token=<verify-token>, forwarding the same JWT as a query param (not a logged-in session), where ProfileCompletion.tsx collects the rest of the org's details and does POST /agent/register?token=....
- Today a volunteer isn't branched at all,
verify-email falls into the else case and pushes straight to /dashboard with no session established, which likely just bounces to login. Extend that page to also check for role=volunteer and redirect to the new completion route, same token-forwarding pattern.
Fields to collect
The public "become a volunteer" form (src/components/forms/BecomeVolunteer/, VolunteerFormData) already defines the full field shape we need: postcode, districts, availability, languages, activities, skills, certificate of good conduct, measles vaccination proof, how they heard about us, comments. Reuse that shape/component where practical rather than re-designing the fields. First/last name, email, and phone are already known from the account step and shouldn't be asked again.
Backend work required (unlike #954, this one isn't fe-only)
Checked the be repo: there's no self-service way for an authenticated volunteer to create their own profile today.
POST /volunteer/legacy is public/anonymous and not linked to any Person/User account, it's the legacy form's endpoint, not reusable as-is.
POST /volunteer (the real volunteer route) requires fastify.authenticate() and role: UserRole.COORDINATOR, a self-registering volunteer can't call it.
Volunteer.personId is a straightforward @ManyToOne(Person), the same Person a self-registered volunteer's User already points to, so linking is structurally simple, but the endpoint/authorization to do it doesn't exist.
This needs a paired be issue for a self-service endpoint analogous to POST /agent/register, e.g. POST /volunteer/register?token=..., that verifies the token and creates the Volunteer linked to the already-created Person. Please file (or point me to) that be issue before implementation starts here.
Scope
- Extend
verify-email/[token]/page.tsx to redirect a confirmed volunteer to the new completion route.
- New route/component (e.g.
/register/volunteer/complete), analogous to AgentRegistration/ProfileCompletion/, pre-filled with nothing (name/email/phone aren't shown again since they're already saved), collecting the remaining VolunteerFormData fields.
- Depends on the paired
be endpoint above.
Related
Description
Continuation of #954 / #955 (volunteer self-registration). Once a volunteer confirms their email, they currently land nowhere meaningful, this issue adds the missing step: a "volunteer profile" form, pre-filled with the account details they already entered (name, email, phone) and empty for everything else, that opens right after they click the confirmation link in their email.
This mirrors the existing agent flow exactly:
verify-email/[token]/page.tsxalready branches on the registering role: after verifying, an "agent" is sent to/register/agent/complete?token=<verify-token>, forwarding the same JWT as a query param (not a logged-in session), whereProfileCompletion.tsxcollects the rest of the org's details and doesPOST /agent/register?token=....verify-emailfalls into theelsecase and pushes straight to/dashboardwith no session established, which likely just bounces to login. Extend that page to also check forrole=volunteerand redirect to the new completion route, same token-forwarding pattern.Fields to collect
The public "become a volunteer" form (
src/components/forms/BecomeVolunteer/,VolunteerFormData) already defines the full field shape we need: postcode, districts, availability, languages, activities, skills, certificate of good conduct, measles vaccination proof, how they heard about us, comments. Reuse that shape/component where practical rather than re-designing the fields. First/last name, email, and phone are already known from the account step and shouldn't be asked again.Backend work required (unlike #954, this one isn't fe-only)
Checked the
berepo: there's no self-service way for an authenticated volunteer to create their own profile today.POST /volunteer/legacyis public/anonymous and not linked to any Person/User account, it's the legacy form's endpoint, not reusable as-is.POST /volunteer(the real volunteer route) requiresfastify.authenticate()androle: UserRole.COORDINATOR, a self-registering volunteer can't call it.Volunteer.personIdis a straightforward@ManyToOne(Person), the samePersona self-registered volunteer'sUseralready points to, so linking is structurally simple, but the endpoint/authorization to do it doesn't exist.This needs a paired
beissue for a self-service endpoint analogous toPOST /agent/register, e.g.POST /volunteer/register?token=..., that verifies the token and creates theVolunteerlinked to the already-createdPerson. Please file (or point me to) thatbeissue before implementation starts here.Scope
verify-email/[token]/page.tsxto redirect a confirmed volunteer to the new completion route./register/volunteer/complete), analogous toAgentRegistration/ProfileCompletion/, pre-filled with nothing (name/email/phone aren't shown again since they're already saved), collecting the remainingVolunteerFormDatafields.beendpoint above.Related
src/components/AgentRegistration/ProfileCompletion/ProfileCompletion.tsxandsrc/app/[lang]/register/agent/complete/