Skip to content
8 changes: 5 additions & 3 deletions artifacts/sandbox-ai/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ function PublicOnlyRouter() {
<Switch>
<Route path="/" component={Home} />
<Route path="/about" component={About} />
<Route path="/pricing" component={Pricing} />
<Route path="/pricing">
<Redirect to="/" />
</Route>
<Route path="/get-app" component={GetApp} />
<Route path="/auth" component={AuthPortal} />
<Route path="/mobile-dashboard" component={MobileDashboard} />
Expand All @@ -287,10 +289,10 @@ function PublicOnlyRouter() {
<Route path="/download" component={Download} />
<Route path="/health-config" component={HealthConfigPage} />
<Route path="/sign-in/*?">
<Redirect to="/" />
<Redirect to="/auth" />
</Route>
<Route path="/sign-up/*?">
<Redirect to="/" />
<Redirect to="/auth" />
</Route>
<Route path="/chat">
<Redirect to="/" />
Expand Down
16 changes: 13 additions & 3 deletions artifacts/sandbox-ai/src/pages/auth-portal.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
import { Link } from "wouter";
import { isAuthEnabled } from "@/config/auth-mode";

export default function AuthPortal() {
const signInHref = isAuthEnabled ? "/sign-in" : "/health-config";
const signUpHref = isAuthEnabled ? "/sign-up" : "/health-config";

return (
<div className="min-h-screen bg-black text-white p-6">
<div className="max-w-md mx-auto pt-12 space-y-6">
<h1 className="text-3xl font-black">Đăng nhập / Đăng ký</h1>
<p className="text-sm text-white/70">
Quy trình OAuth (Google/GitHub) được xử lý qua Clerk. Bấm nút bên dưới để vào trang xác thực chính thức.
{isAuthEnabled
? "Quy trình OAuth (Google/GitHub) được xử lý qua Clerk. Bấm nút bên dưới để vào trang xác thực chính thức."
: "Auth đang chạy ở chế độ public nên đăng nhập/đăng ký tạm thời không khả dụng. Mở Health Config để xem biến môi trường cần thiết."}
</p>
<div className="grid gap-3">
<Link href="/sign-in" className="rounded-xl px-4 py-3 bg-cyan-400 text-black font-bold text-center">Tiếp tục với Google / GitHub</Link>
<Link href="/sign-up" className="rounded-xl px-4 py-3 border border-white/20 font-semibold text-center">Tạo tài khoản mới</Link>
<Link href={signInHref} className="rounded-xl px-4 py-3 bg-cyan-400 text-black font-bold text-center">
{isAuthEnabled ? "Tiếp tục với Google / GitHub" : "Mở Health Config"}
</Link>
<Link href={signUpHref} className="rounded-xl px-4 py-3 border border-white/20 font-semibold text-center">
{isAuthEnabled ? "Tạo tài khoản mới" : "Xem cấu hình auth"}
</Link>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion artifacts/sandbox-ai/src/pages/termux-lab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function TermuxLab() {
{logs.map((l, i) => <div key={i}>{l}</div>)}
</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" />
<input aria-label="Command" 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>
Expand Down