💬 New comment on subscription-page#54 feat: add Cheezy account hub
by @greptile-apps[bot]
<h3>Greptile Summary</h3>
Adds an opt-in Cheezy account-management hub to subscription pages.
- Introduces OAuth/PKCE login, session and CSRF cookies, subscription attachment, transfer, renewal, and logout BFF endpoints.
- Adds the account widget and localized account-management UI.
- Adds Cheezy configuration validation, documentation, sample environment values, and URL-redacting access logging.
<h3>Confidence Score: 2/5</h3>
The PR is not safe to merge until client-specific paths, configured route prefixes, and subscription identifier logging are handled correctly.
Supported client-specific URLs send the wrong subscription identifier to the account API, prefixed deployments cannot reach the hard-coded account endpoints, and two-segment subscription URLs remain unredacted in access logs.
Files Needing Attention: backend/src/main.ts, backend/src/modules/root/account-hub.controller.ts, frontend/src/widgets/main/account-hub/account-hub.widget.tsx
<details open><summary><h3>Security Review</h3></summary>
Client-specific subscription paths are not matched by the new log-redaction expression, so their short subscription identifiers remain exposed in access logs.
</details>
<h3>Important Files Changed</h3>
| Filename | Overview |
|----------|----------|
| backend/src/modules/root/account-hub.controller.ts | Adds the account BFF and OAuth flow, but generated account URLs do not honor the configured global prefix. |
| frontend/src/widgets/main/account-hub/account-hub.widget.tsx | Adds account-management UI, but misidentifies subscriptions on client-specific routes and hard-codes unprefixed BFF endpoints. |
| backend/src/main.ts | Adds access-log URL redaction, but supported two-segment subscription paths still expose their identifiers. |
| backend/src/common/config/app-config/config.schema.ts | Adds opt-in Cheezy configuration with a false default and conditional validation of required URLs. |
| frontend/src/pages/main/ui/components/main.page.component.tsx | Integrates the new account widget into the main subscription page. |
<h3>Sequence Diagram</h3>
sequenceDiagram
participant U as User browser
participant W as AccountHubWidget
participant B as Subscription-page BFF
participant P as Cheezy portal
U->>W: Open subscription page
W->>B: "GET /_account/state?short_uuid=..."
B->>P: Create subscription context
P-->>B: Signed context
alt Guest
B-->>W: Login URL
U->>B: GET /_account/login
B->>P: OAuth authorize with PKCE
P-->>B: Authorization callback
B->>P: Exchange code and verifier
P-->>B: Session token
B-->>U: HttpOnly session cookie and redirect
else Authenticated
B->>P: User and subscriptions
P-->>B: Account state
B-->>W: Profiles and CSRF token
W->>B: Attach or transfer with CSRF token
B->>P: Authorized mutation
P-->>B: Mutation result
B-->>W: Updated result
end
<!-- greptile_other_comments_section -->
<sub>Reviews (1): Last reviewed commit: "feat: add Cheezy account hub" | [Re-trigger Greptile](https://app.greptile.com/api/retrigger?id=47360324)</sub>
Reply to this message to post a comment on GitHub.