Commit Graph

13 Commits

Author SHA1 Message Date
697b0d9ef2 feat(auth): unify login flow and update login visuals
One sign-in page for everyone. /login is the only entry point; the
short-lived /admin/login and /staff/login routes are gone, along with the
per-route branding that came with them. Admin, owner, manager and staff see
the same form, post the same {email, password} to the same
POST /api/auth/login, and are never asked to say who they are.

Where somebody lands is decided by the role the BACKEND returns, never by
the URL they arrived at:

  owner, manager -> /dashboard
  staff          -> /floor

roleDestination is the single map, read by all three redirect paths - the
hydrated form, the no-JavaScript form POST, and GuestGuard. GuestGuard
raced the form to a hardcoded /dashboard, so a staff member landed in a
different place depending on which effect fired first; it now resolves
through the same map.

A platform admin authenticates correctly and still gets no session here.
Every surface in this console is tenant-scoped and an admin has no tenant
(auth.go: "ClientID empty means a platform admin"). Measured against a real
admin token: /api/sites 500, /api/visits 500, /api/visitors 500, /api/team
403 "This account does not belong to a company." So the BFF declines to set
the cookie rather than handing out a dashboard of server errors, revokes the
upstream session it will not use, and says so on /login through the existing
fixed-code table. Their surface is Companies in the platform's own web app,
which this console does not link to and does not hand a token - no session
handoff exists between the two, and inventing one would mean putting a
credential in a URL.

No enumeration is given up: a wrong password for an admin is answered
exactly like every other wrong password, so the "wrong console" message only
ever reaches somebody who has already proved they own the account.

Login visuals: the hero carousel now anchors each slide independently -
slide 1 (mascot with bag) to the bottom so the white bag clears the white
caption, slide 2 (selfie booth) to the top so the arch and wordmark are not
cropped by the rounded corner.

Unchanged: the BFF, the sealed httpOnly token cookie, the signed session
cookie, refresh, logout, route protection and the open-redirect guard on
?next=.

Verified against the live local platform with real accounts for all four
roles, plus wrong-password, unknown-email, empty-field, invalid-format and
inactive-user cases, session persistence, a forced token refresh, logout,
and two-tenant isolation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161AMotQ8FxGPZ9gFGb5wiK
2026-09-16 15:45:17 +05:30
bfe4d3d2f2 update ui and remove mock data 2026-09-09 19:50:52 +05:30
5ce580dced ligth theme design fix 2026-08-10 15:33:13 +05:30
6cc3c9a0b7 update dark and ligth theme 2026-08-10 12:35:18 +05:30
f80c1d9f5d fix sales issue 2026-08-06 18:13:59 +05:30
32847159ae update sales page 2026-08-06 17:46:17 +05:30
469ad3021c fix mobile issue 2026-08-06 17:09:08 +05:30
11daadc0a3 comment voice icon 2026-08-06 16:13:58 +05:30
b23ea760c8 fix chatbox 2026-08-06 15:43:46 +05:30
e5f8144fb3 update ui update and fix layout issue 2026-08-06 13:21:10 +05:30
92322bff16 login page logo fix 2026-08-05 18:43:07 +05:30
9d7bbad32c dashboard design changes 2026-08-05 18:34:37 +05:30
2c8c394795 first commit 2026-08-05 15:26:50 +05:30