Skip to content

feat(customer-portal): block portal until white-label MSA is signed - #7

Merged
rrader26 merged 2 commits into
mainfrom
feat/portal-msa-gate
Jun 16, 2026
Merged

feat(customer-portal): block portal until white-label MSA is signed#7
rrader26 merged 2 commits into
mainfrom
feat/portal-msa-gate

Conversation

@rrader26

Copy link
Copy Markdown

What

Blocks the customer portal until a white-label / SDK customer signs the MSA. When customerPortalUser.mustSignAgreement is true, the portal renders a blocking AgreementGate (with a "Review & Sign Agreement" button linking to the hosted signing page) instead of wallet/usage/invoices/plans.

The signing surface is the existing hosted gate page (/white-label/:token) — it renders the MSA/Terms, records the signature, and collects a payment method. Acceptance is tracked in Lago (white_label_agreements).

Depends on

  • lago-api PR feat/white-label-portal-gate — adds mustSignAgreement + agreementSigningUrl to CustomerPortalCustomer.
  • Run pnpm codegen against a lago-api that carries those fields before this typechecks/builds (codegen reads the live schema via CODEGEN_API).

Files

  • AgreementGate.tsx — new blocking panel
  • CustomerPortalSections.tsx — early-return the gate when mustSignAgreement
  • useCustomerPortalData.ts — query the two new fields

🤖 Generated with Claude Code

When customerPortalUser.mustSignAgreement is true, the portal renders a blocking
AgreementGate (link to the hosted signing page) instead of any billing sections.
Reuses the existing gate page as the signing surface.

NOTE: requires `pnpm codegen` against a lago-api carrying the new
mustSignAgreement / agreementSigningUrl fields before this typechecks/builds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n dependency)

The generated useGetCustomerPortalDataQuery uses a pre-generated document, so the
new white-label fields would be inert until `pnpm codegen` re-runs. Switch to a
dedicated raw useQuery hook (useCustomerPortalAgreement) — same precedent as the
create-org change — so this builds and works without regenerating types.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rrader26
rrader26 merged commit c3e27d9 into main Jun 16, 2026
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants