Skip to content

chore: expose web app runner - #2

Open
mythofkas-commits wants to merge 1 commit into
mainfrom
codex/build-mvp-for-rollout-radar-app-oz8f2s
Open

chore: expose web app runner#2
mythofkas-commits wants to merge 1 commit into
mainfrom
codex/build-mvp-for-rollout-radar-app-oz8f2s

Conversation

@mythofkas-commits

Copy link
Copy Markdown
Owner

Summary

  • add a root pnpm workspace wrapper so the Next.js web app can be managed from the repo root
  • document local development steps and supported hosting targets in both READMEs

Testing

  • not run (not requested)

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

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

Copy link
Copy Markdown

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

Comment on lines +75 to +82
export async function requireAdmin() {
const user = await getSessionUser();
if (!user) {
throw Object.assign(new Error('Unauthorized'), { status: 401 });
}
if (user.role !== 'ADMIN') {
throw Object.assign(new Error('Forbidden'), { status: 403 });
}

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] Return 401/403 instead of throwing in admin guard

requireAdmin throws generic Error objects with a status property, but the API routes that call it do not catch these errors. In Next.js route handlers an uncaught error always becomes a 500 response, so unauthorized or forbidden callers receive a 500 instead of the expected 401/403. This makes it impossible for clients (or automated tools) to distinguish authentication failures from server errors. Consider having requireAdmin return a NextResponse or handling the error in the route before returning.

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