diff --git a/src/api/config.ts b/src/api/config.ts index ffe8eee..025b362 100644 --- a/src/api/config.ts +++ b/src/api/config.ts @@ -47,6 +47,9 @@ export const TOUCH_POINTS: Array<{ label: string; keys: string[] }> = [ { label: 'Buyer / Account', keys: ['buyer_account'] }, ]; +/** Demo only: every demo user shares this password, shown on the login page. */ +export const DEMO_PASSWORD = 'Bunker@2026'; + export const DEMO_USERS = [ { email: 'ops.mundra@bunker-demo.example', name: 'Rakesh Patel', role: 'Operations, Mundra' }, { email: 'ops.hazira@bunker-demo.example', name: 'Sneha Iyer', role: 'Operations, Hazira' }, diff --git a/src/screens/Login.tsx b/src/screens/Login.tsx index 880222d..4b68054 100644 --- a/src/screens/Login.tsx +++ b/src/screens/Login.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import { Droplet } from 'lucide-react'; import { useZino } from '../api/provider'; -import { DEMO_USERS, ORG_ID } from '../api/config'; +import { DEMO_PASSWORD, DEMO_USERS, ORG_ID } from '../api/config'; import { ErrorNote } from '../components/ui'; export function Login() { @@ -11,13 +11,14 @@ export function Login() { const [busy, setBusy] = useState(false); const [error, setError] = useState(null); - const submit = async (e: React.FormEvent) => { - e.preventDefault(); + const signIn = async (em: string, pw: string) => { setBusy(true); setError(null); - try { await login(email.trim(), password, ORG_ID); } + try { await login(em.trim(), pw, ORG_ID); } catch (err) { setError((err as { message?: string })?.message ?? 'Sign-in failed'); } finally { setBusy(false); } }; + const submit = (e: React.FormEvent) => { e.preventDefault(); void signIn(email, password); }; + const pick = (em: string) => { setEmail(em); setPassword(DEMO_PASSWORD); void signIn(em, DEMO_PASSWORD); }; return (
@@ -42,12 +43,19 @@ export function Login() {
-

Demo users

+
+

Demo users · click to sign in

+

Password {DEMO_PASSWORD}

+
    {DEMO_USERS.map((u) => (
  • -
  • ))}