# Proposal ## Why Auth is the last thing between the mall and real accounts. The fixed-data adapter accepts any credentials and always returns the same demo user, so login, register and "me" are theatre — and every domain needing a bearer token (cart, orders, invoices) is pinned behind them. `shop-admin` and `admin` already authenticate against the live backend. ## What Changes - Flip the `auth` domain to live via `liveDomains`; cart, orders, shipments and invoices stay on fixed data. - Align the client password rule with the API: the panels require 6 characters, but `/auth/register` requires 8 and answers 400 (`apps/api/src/routes/auth.rs:32`). - Map real failures to distinct messages — 401 for bad credentials, 409 when an email is taken — instead of one generic "request failed". - Drop the register SMS-code field: its button only runs a countdown, there is no endpoint, and the value is never sent, so it is a mandatory no-op once auth is real. - Validate a stored token through `/auth/me` on load rather than trusting `localStorage` alone. - **BREAKING** (auth UX): the demo's "log in as anyone, any password" behaviour ends; wrong credentials now fail. ## Capabilities ### New Capabilities (none) ### Modified Capabilities - `frontend-mall`: the "Auth and buyer center" requirement stops being backed by deterministic mock auth and uses the live auth API. ## Impact `apps/mall/plugins/api.ts` and `apps/mall/nuxt.config.ts` (`liveDomains`), `pages/login.vue`, `pages/register.vue`, `stores/session.ts`, `middleware/auth.ts`, and `locales-extra.ts` for the new error strings. No backend or `shop-admin`/`admin` change. ## Non-goals Cart, orders, shipments and invoices stay on fixed data: the mock adapter holds `cart -> orders -> shipments` as one shared state, so flipping cart alone would fail checkout with `EMPTY_CART`. They move together in a later wave. No store, address, favourite or coupon work.