Skip to content

Clarify unavailable login in public mode and keep auth routes reachable#29

Open
Huynhthuongg wants to merge 5 commits into
revert-13-revert-12-revert-11-dependabot/npm_and_yarn/npm_and_yarn-888b5d1ce8from
codex/fix-high-priority-bug-in-public-fallback
Open

Clarify unavailable login in public mode and keep auth routes reachable#29
Huynhthuongg wants to merge 5 commits into
revert-13-revert-12-revert-11-dependabot/npm_and_yarn/npm_and_yarn-888b5d1ce8from
codex/fix-high-priority-bug-in-public-fallback

Conversation

@Huynhthuongg

@Huynhthuongg Huynhthuongg commented May 23, 2026

Copy link
Copy Markdown
Member

Summary by cubic

Clarified login behavior in public mode and kept auth routes reachable with a clear AuthPortal. Added a /health-config page for quick environment checks and a public-only router that redirects protected pages and shows a small notice.

  • New Features

    • Added public auth mode fallback when VITE_AUTH_MODE=public or VITE_CLERK_PUBLISHABLE_KEY is missing; app uses a public-only router that redirects /chat* and /pricing to /, keeps /download, /auth, /sign-in, and /sign-up reachable, and routes sign-in/up to AuthPortal.
    • Introduced /health-config to display auth mode, required envs, and readiness.
    • Added lightweight pages: /mobile-dashboard, /chat-static, /termux-lab, /tools.
  • Refactors

    • Centralized auth/env logic in src/config/auth-mode.ts; App.tsx now wraps the public fallback in WouterRouter and uses PublicAppWithoutAuth with an on-screen notice.
    • Fixed minor type issues in chat components and simplified tsconfig.json.
    • Added docs_self_healing_process.md with a short self-healing checklist.

Written for commit 1eb40ac. Summary will update on new commits. Review in cubic

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 97645975-c6bc-4e2e-a351-772474206e12

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-high-priority-bug-in-public-fallback
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/fix-high-priority-bug-in-public-fallback
  • 🛠️ Aethon

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kilo-code-bot

kilo-code-bot Bot commented May 23, 2026

Copy link
Copy Markdown

Kilo Code Review could not run — your account is out of credits.

Add credits or switch to a free model to enable reviews on this change.

@Huynhthuongg Huynhthuongg self-assigned this May 23, 2026
@Huynhthuongg Huynhthuongg added bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers invalid This doesn't seem right question Further information is requested dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code codex labels May 23, 2026
@Huynhthuongg Huynhthuongg added this to the Sandbox milestone May 23, 2026

@cubic-dev-ai cubic-dev-ai 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.

11 issues found across 12 files

Confidence score: 3/5

  • There is meaningful regression risk in artifacts/sandbox-ai/src/App.tsx: core auth/routing behavior changed (PublicAppWithoutAuth/PublicOnlyRouter) without accompanying tests, so auth-gated navigation could break unnoticed.
  • Accessibility issues are user-impacting and high confidence, especially in artifacts/sandbox-ai/src/pages/mobile-dashboard.tsx (icon-only toggle missing accessible name) and artifacts/sandbox-ai/src/pages/chat-static.tsx (disabled input missing label/ARIA name).
  • Several high-confidence i18n gaps in artifacts/sandbox-ai/src/pages/auth-portal.tsx, artifacts/sandbox-ai/src/pages/termux-lab.tsx, and artifacts/sandbox-ai/src/config/auth-mode.ts increase localization inconsistency risk; plus auth-mode.ts/App.tsx include config messaging inaccuracies that can mislead users.
  • Pay close attention to artifacts/sandbox-ai/src/App.tsx, artifacts/sandbox-ai/src/config/auth-mode.ts, artifacts/sandbox-ai/src/pages/mobile-dashboard.tsx, and artifacts/sandbox-ai/src/pages/auth-portal.tsx - routing/auth flow changes lack tests, config status/banner logic may misreport state, and accessibility/i18n issues are directly user-facing.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="artifacts/sandbox-ai/src/pages/chat-static.tsx">

<violation number="1" location="artifacts/sandbox-ai/src/pages/chat-static.tsx:18">
P2: Custom agent: **Enforce Accessibility Standards (WCAG...)**

Disabled `<input>` element lacks an accessible label or ARIA naming, violating WCAG screen-reader compatibility requirements.</violation>
</file>

<file name="artifacts/sandbox-ai/src/pages/termux-lab.tsx">

<violation number="1" location="artifacts/sandbox-ai/src/pages/termux-lab.tsx:3">
P2: Custom agent: **Enforce Pragmatic Test Coverage**

New interactive UI component `TermuxLab` added with no test coverage for user-visible interaction or state change.</violation>

<violation number="2" location="artifacts/sandbox-ai/src/pages/termux-lab.tsx:8">
P2: Custom agent: **Enforce i18n for User-Facing Strings**

User-facing heading text is hardcoded instead of using i18n translation functions.</violation>

<violation number="3" location="artifacts/sandbox-ai/src/pages/termux-lab.tsx:14">
P2: Custom agent: **Enforce i18n for User-Facing Strings**

User-facing button label is hardcoded instead of using i18n translation functions.</violation>
</file>

<file name="artifacts/sandbox-ai/src/config/auth-mode.ts">

<violation number="1" location="artifacts/sandbox-ai/src/config/auth-mode.ts:22">
P2: Custom agent: **Enforce i18n for User-Facing Strings**

Raw user-facing hint strings in envChecklist are not wrapped with i18n translation keys/functions.</violation>
</file>

<file name="artifacts/sandbox-ai/src/App.tsx">

<violation number="1" location="artifacts/sandbox-ai/src/App.tsx:275">
P3: PublicOnlyRouter duplicates much of Router, increasing maintenance drift risk between auth-enabled and public-mode navigation.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread artifacts/sandbox-ai/src/App.tsx
Comment thread artifacts/sandbox-ai/src/pages/mobile-dashboard.tsx
Comment thread artifacts/sandbox-ai/src/pages/auth-portal.tsx
Comment thread artifacts/sandbox-ai/src/config/auth-mode.ts
Comment thread artifacts/sandbox-ai/src/App.tsx Outdated
@@ -0,0 +1,18 @@
import { useState } from "react";

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: Custom agent: Enforce Pragmatic Test Coverage

New interactive UI component TermuxLab added with no test coverage for user-visible interaction or state change.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At artifacts/sandbox-ai/src/pages/termux-lab.tsx, line 3:

<comment>New interactive UI component `TermuxLab` added with no test coverage for user-visible interaction or state change.</comment>

<file context>
@@ -0,0 +1,18 @@
+import { useState } from "react";
+
+export default function TermuxLab() {
+  const [cmd, setCmd] = useState("npm run build");
+  const [logs, setLogs] = useState<string[]>(["[termux] session booted", "[ai] ready to suggest commands"]);
</file context>

</div>
<div className="flex gap-2">
<input value={cmd} onChange={(e) => setCmd(e.target.value)} className="flex-1 bg-white/10 text-white px-3 py-2 rounded" />
<button onClick={() => setLogs((v) => [...v, `$ ${cmd}`, "[ai] suggestion: add --verbose if fail"])} className="px-3 py-2 rounded bg-cyan-500 text-black font-bold">Run</button>

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: Custom agent: Enforce i18n for User-Facing Strings

User-facing button label is hardcoded instead of using i18n translation functions.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At artifacts/sandbox-ai/src/pages/termux-lab.tsx, line 14:

<comment>User-facing button label is hardcoded instead of using i18n translation functions.</comment>

<file context>
@@ -0,0 +1,18 @@
+      </div>
+      <div className="flex gap-2">
+        <input value={cmd} onChange={(e) => setCmd(e.target.value)} className="flex-1 bg-white/10 text-white px-3 py-2 rounded" />
+        <button onClick={() => setLogs((v) => [...v, `$ ${cmd}`, "[ai] suggestion: add --verbose if fail"])} className="px-3 py-2 rounded bg-cyan-500 text-black font-bold">Run</button>
+      </div>
+    </div>
</file context>

const [logs, setLogs] = useState<string[]>(["[termux] session booted", "[ai] ready to suggest commands"]);
return (
<div className="min-h-screen bg-black text-green-300 p-4 font-mono">
<h1 className="text-white font-bold mb-4">Termux nền + AI command assistant (mock)</h1>

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: Custom agent: Enforce i18n for User-Facing Strings

User-facing heading text is hardcoded instead of using i18n translation functions.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At artifacts/sandbox-ai/src/pages/termux-lab.tsx, line 8:

<comment>User-facing heading text is hardcoded instead of using i18n translation functions.</comment>

<file context>
@@ -0,0 +1,18 @@
+  const [logs, setLogs] = useState<string[]>(["[termux] session booted", "[ai] ready to suggest commands"]);
+  return (
+    <div className="min-h-screen bg-black text-green-300 p-4 font-mono">
+      <h1 className="text-white font-bold mb-4">Termux nền + AI command assistant (mock)</h1>
+      <div className="rounded-xl border border-green-500/30 p-3 mb-3 bg-green-950/20">
+        {logs.map((l, i) => <div key={i}>{l}</div>)}
</file context>

value: import.meta.env.VITE_AUTH_MODE,
required: false,
status: "info" as const,
hint: "Optional. Use 'clerk' (default) or 'public'.",

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: Custom agent: Enforce i18n for User-Facing Strings

Raw user-facing hint strings in envChecklist are not wrapped with i18n translation keys/functions.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At artifacts/sandbox-ai/src/config/auth-mode.ts, line 22:

<comment>Raw user-facing hint strings in envChecklist are not wrapped with i18n translation keys/functions.</comment>

<file context>
@@ -0,0 +1,38 @@
+    value: import.meta.env.VITE_AUTH_MODE,
+    required: false,
+    status: "info" as const,
+    hint: "Optional. Use 'clerk' (default) or 'public'.",
+  },
+  {
</file context>

}


function PublicOnlyRouter() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: PublicOnlyRouter duplicates much of Router, increasing maintenance drift risk between auth-enabled and public-mode navigation.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At artifacts/sandbox-ai/src/App.tsx, line 275:

<comment>PublicOnlyRouter duplicates much of Router, increasing maintenance drift risk between auth-enabled and public-mode navigation.</comment>

<file context>
@@ -258,14 +271,57 @@ function ClerkProviderWithRoutes() {
 }
 
+
+function PublicOnlyRouter() {
+  return (
+    <Switch>
</file context>

@Huynhthuongg Huynhthuongg left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@Huynhthuongg @anthropic-code-agent @openai-code-agent

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
@vercel

vercel Bot commented May 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sanbox Ready Ready Preview, Comment May 23, 2026 1:09am

@cubic-dev-ai cubic-dev-ai 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.

0 issues found across 1 file (changes from recent commits).

Requires human review: Auto-approval blocked by 6 unresolved issues from previous reviews.

Re-trigger cubic

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

Labels

bug Something isn't working codex dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed invalid This doesn't seem right javascript Pull requests that update javascript code question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

**No issues found** across 1 file **Describe the bug** Sữa lỗi Tính năng

1 participant