Skip to content

Implement client confirmation endpoint and success page#4

Open
nasmans wants to merge 1 commit intomainfrom
codex/add-client-id-generation-function
Open

Implement client confirmation endpoint and success page#4
nasmans wants to merge 1 commit intomainfrom
codex/add-client-id-generation-function

Conversation

@nasmans
Copy link
Copy Markdown
Owner

@nasmans nasmans commented Oct 29, 2025

Summary

  • scaffold a Next.js application structure with shared styling and configuration
  • add a client confirmation API that persists client records, generates IDs/QR codes, and prepares confirmation email content
  • build a registration success page that displays client details and QR code fetched via the new API

Testing

  • npm install (fails: npm registry responded with 403)

https://chatgpt.com/codex/tasks/task_b_69026209006c83288f6e30a61df92a48

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +69 to +72
const protocol = (req.headers['x-forwarded-proto'] as string | undefined) ?? 'http';
const host = req.headers.host ?? 'localhost:3000';
const baseUrl = process.env.NEXT_PUBLIC_APP_URL ?? process.env.APP_URL ?? `${protocol}://${host}`;
const confirmationUrl = `${baseUrl.replace(/\/$/, '')}/registration/success?id=${clientId}`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Build confirmation URL from untrusted request headers

The confirmation endpoint constructs confirmationUrl from x-forwarded-proto and host whenever NEXT_PUBLIC_APP_URL/APP_URL are absent. Both headers are fully controllable by the caller, so a crafted POST can cause the API (or any email that reuses the returned preview) to contain attacker-controlled links and schemes. This is a classic host-header injection issue; the URL should be derived from a trusted configuration value or validated against an allow-list before use.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant