Skip to content

Fix code issues - #12

Open
Shakeyswings wants to merge 11 commits into
mainfrom
fix/my-code-fixes
Open

Fix code issues#12
Shakeyswings wants to merge 11 commits into
mainfrom
fix/my-code-fixes

Conversation

@Shakeyswings

Copy link
Copy Markdown
Owner

Explain what you fixed

@Shakeyswings

Copy link
Copy Markdown
Owner Author

/opencode fix the Dependabot vulnerability

@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.

Reviewed commit: bdee92ed30

ℹ️ 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".


return createClient(url, anonKey);
}
export function createClient() {

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 Keep getBrowserSupabase exported

When this replacement lands, existing modules still import getBrowserSupabase (src/app/auth/page.tsx and src/lib/database/missions.ts; searched repo-wide for getBrowserSupabase). Those routes/features will fail to build/load because this file no longer exports the symbol, so keep a compatibility export or update all callers in the same change.

Useful? React with 👍 / 👎.

Comment thread src/middleware.ts Outdated
} = await supabase.auth.getUser();

// If no user and trying to access protected route, redirect to login
if (!user && !request.nextUrl.pathname.startsWith("/login")) {

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 Allow unauthenticated access to signup

With the matcher covering /signup, this condition only exempts /login, so an unauthenticated user clicking the new login-page /signup link is immediately redirected back to /login before the signup page can render. That prevents new users from creating accounts unless they already have a session; add /signup to the public-route check.

Useful? React with 👍 / 👎.

Comment thread src/middleware.ts Outdated
Comment on lines +10 to +12
const supabase = createServerClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard Supabase middleware when keys are absent

In environments before Supabase keys are configured, this middleware still runs on every non-static request and passes undefined env values into createServerClient, which makes the app fail before pages like settings/auth can show the existing “missing Supabase keys” guidance. Since the repo still has explicit missing-key UI and fallback behavior, skip auth middleware or return NextResponse.next() until both public keys are present.

Useful? React with 👍 / 👎.

Comment thread ai-engineering-platform Outdated
@@ -0,0 +1 @@
Subproject commit d4c373f380a5c16899021fe52828066029809197

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove unmapped gitlink entries

This commit adds ai-engineering-platform and ai-engineering-platform - Copy as gitlink/submodule entries but does not add a .gitmodules mapping; after this change, git submodule status fails with no submodule mapping found in .gitmodules for path 'ai-engineering-platform'. Anyone using submodule-aware checkout/update commands will hit that repository error, so remove the accidental nested gitlinks or add proper submodule metadata.

Useful? React with 👍 / 👎.

Comment thread src/lib/supabase/client.ts Outdated
Comment on lines +5 to +6
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve missing-key fallback in browser client

In local/demo environments where NEXT_PUBLIC_SUPABASE_URL or NEXT_PUBLIC_SUPABASE_ANON_KEY is not configured, this now passes undefined into createBrowserClient instead of returning null like the previous helper. The new /login and /signup pages call createClient() during render, so even after the middleware is bypassed those public auth pages can crash instead of showing the repo's existing missing-key guidance.

Useful? React with 👍 / 👎.

Comment thread src/app/signup/page.tsx Outdated
setError(error.message);
setLoading(false);
} else {
router.push("/");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle unconfirmed signups before redirecting home

When Supabase email confirmation is enabled, signUp can succeed without creating a session, but this branch immediately sends the user to the protected home page. The middleware then redirects them back to /login with no indication that they need to confirm their email, so the signup flow looks like it silently failed; keep them on the page with a confirmation message or route them to an explicit check-email state.

Useful? React with 👍 / 👎.

@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.

Reviewed commit: db01315c10

ℹ️ 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 thread src/lib/supabase/server.ts Outdated
import { cookies } from "next/headers";

export function createClient() {
const cookieStore = cookies();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make the server Supabase helper await cookies()

This repo pins Next 16.2.10, where cookies() from next/headers is async. As written, cookieStore is the unresolved Promise, so the first server-side use of this helper will call getAll/set on a Promise inside the Supabase cookie adapter and fail before authenticated server reads can complete; make createClient async and await cookies() before wiring the adapter.

Useful? React with 👍 / 👎.

Comment thread src/middleware.ts

export const config = {
matcher: [
"/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Return JSON errors for unauthenticated API calls

This matcher also runs the auth redirect on /api/mission/generate, while src/app/missions/new/page.tsx fetches that route and immediately parses JSON. If a session expires while the form is open, or an API client posts without a session, the request gets a redirect/login response instead of JSON, so mission creation throws and stays in the loading path; exclude API routes from this page redirect or return a 401 JSON response for them.

Useful? React with 👍 / 👎.

@Shakeyswings Shakeyswings left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

4 files from beer spillage... Deleted from my phone

…s, await cookies, fix middleware logic, add compatibility exports
@Shakeyswings
Shakeyswings enabled auto-merge (squash) July 12, 2026 15:47
@Shakeyswings
Shakeyswings disabled auto-merge July 12, 2026 15:48

@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.

Reviewed commit: f884527a98

ℹ️ 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 thread src/app/login/page.tsx
setLoading(true);
setError("");

const { error } = await supabase.auth.signInWithPassword({

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard the nullable Supabase client in login

Fresh evidence after the missing-key fallback fix: createClient() now returns null when NEXT_PUBLIC_SUPABASE_URL or NEXT_PUBLIC_SUPABASE_ANON_KEY is absent, but this login handler still dereferences it. Submitting /login in the local/demo missing-key state throws before the page can show an error, unlike /signup which already guards this case; add the same null check here.

Useful? React with 👍 / 👎.

@Shakeyswings
Shakeyswings enabled auto-merge (squash) July 12, 2026 15:52
@Shakeyswings
Shakeyswings disabled auto-merge July 12, 2026 16:02
@Shakeyswings Shakeyswings reopened this Jul 12, 2026
@Shakeyswings
Shakeyswings enabled auto-merge (squash) July 12, 2026 16:04

@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.

Reviewed commit: c86c899fe6

ℹ️ 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 thread src/app/page.tsx
import Dashboard from "@/components/dashboard/Dashboard";

export default function Home() {
export default function Home)

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 Restore valid Home component syntax

This change leaves the root page as invalid TSX: export default function Home) is missing the parameter list braces and function body opener, so compiling or serving / fails before the dashboard can render. The parent had a valid Home() { ... } component, so restore the function declaration and closing brace.

Useful? React with 👍 / 👎.

Comment thread src/middleware.ts
Comment on lines +15 to +17
if (request.nextUrl.pathname.startsWith("/api/")) {
// Let the API route handle auth via createServerClient
return NextResponse.next({ request });

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 Require auth before bypassing API routes

In deployments with OPENAI_API_KEY configured, this makes every /api/* request skip the only new auth check, but I checked src/app/api/mission/generate/route.ts and it does not authenticate before calling client.responses.create. That leaves the paid mission-generation endpoint callable by unauthenticated clients even though the pages are protected, so either enforce a JSON 401 here or add equivalent auth inside the route before bypassing middleware redirects.

Useful? React with 👍 / 👎.

Comment thread src/middleware.ts

// If no user and trying to access protected route, redirect to login
// But allow signup page for unauthenticated users
if (!user && !request.nextUrl.pathname.startsWith("/login") && !request.nextUrl.pathname.startsWith("/signup")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the existing auth page reachable

This commit still edits and ships src/app/auth/page.tsx, but the new middleware only treats /login and /signup as public. A signed-out user who opens the existing /auth sign-in/sign-up page now gets redirected to /login, making that route's auth UI unreachable unless the user is already authenticated; either add /auth to the public-route check or remove/update the legacy route intentionally.

Useful? React with 👍 / 👎.

@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.

Reviewed commit: b3d4984516

ℹ️ 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 +60 to +61
<StatusIndicator status="96% success ra-[;
mjku . te" tone="info" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore the success-rate label

When the dashboard renders, this prop displays 96% success ra-[; mjku . te instead of the success-rate label, exposing accidental text on the primary MVP dashboard and making the status metric unreadable. Restore the intended 96% success rate text.

AGENTS.md reference: AGENTS.md:L25-L27

Useful? React with 👍 / 👎.

<div>
<h3 className="mb-6 text-[24px] font-semibold leading-[1.3]">Active Missions</h3>
<div className="grid gap-6 md:grid-cols-2 2xl:grid-cols-3">
<div className="grid gap-6 md:grid-cols-2 2xl:grid-cols-3">NM

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the stray mission-grid text

When the Active Missions section renders, the literal NM is emitted as a visible text node immediately before the mission cards. Remove this accidental text so the primary dashboard does not show unexplained characters.

AGENTS.md reference: AGENTS.md:L25-L27

Useful? React with 👍 / 👎.

Comment thread src/middleware.ts
// But allow signup page for unauthenticated users
if (!user && !request.nextUrl.pathname.startsWith("/login") && !request.nextUrl.pathname.startsWith("/signup")) {
const url = request.nextUrl.clone();
url.pathname = "/login";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the protected destination through login

When a signed-out user opens a protected deep link such as /missions/new, this redirect replaces the pathname without recording the original destination, and src/app/login/page.tsx always pushes to / after authentication. The user therefore loses the mission route they intended to open and must navigate back manually; include a validated return path and consume it after login.

AGENTS.md reference: AGENTS.md:L25-L28

Useful? React with 👍 / 👎.

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.

1 participant