feat(customer-portal): block portal until white-label MSA is signed - #7
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Blocks the customer portal until a white-label / SDK customer signs the MSA. When
customerPortalUser.mustSignAgreementis true, the portal renders a blockingAgreementGate(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
feat/white-label-portal-gate— addsmustSignAgreement+agreementSigningUrltoCustomerPortalCustomer.pnpm codegenagainst a lago-api that carries those fields before this typechecks/builds (codegen reads the live schema viaCODEGEN_API).Files
AgreementGate.tsx— new blocking panelCustomerPortalSections.tsx— early-return the gate whenmustSignAgreementuseCustomerPortalData.ts— query the two new fields🤖 Generated with Claude Code