Problem
A freelancer can navigate directly to /client/projects/new or /client/listings/new and the page renders normally. There is no middleware or component-level guard redirecting based on role. The contract will correctly reject unauthorized transactions, but the UX is confusing — a freelancer sees a form, fills it out, and only fails at the signing step.
Proposed Solution
Since wallet address = identity (no fixed role per wallet), the guard should be contextual rather than hard:
Short-term (recommended for demo):
- Add a URL-based notice: if a wallet has no client listings/projects, the client dashboard nudges them to create one. If no projects as freelancer, nudge to browse listings. No hard block.
Medium-term:
- Add a
useRouteGuard hook that checks wallet connectivity before rendering action pages
- Pages like
/client/listings/new should redirect to wallet connect screen if !isConnected (currently shows a wallet prompt inline — redirect is cleaner)
Long-term:
- Allow users to declare a primary role on first connect (stored off-chain in Supabase) and use that to personalize navigation
Acceptance Criteria
Priority
Low — not a correctness issue (contract enforces auth), but degrades UX.
Problem
A freelancer can navigate directly to
/client/projects/newor/client/listings/newand the page renders normally. There is no middleware or component-level guard redirecting based on role. The contract will correctly reject unauthorized transactions, but the UX is confusing — a freelancer sees a form, fills it out, and only fails at the signing step.Proposed Solution
Since wallet address = identity (no fixed role per wallet), the guard should be contextual rather than hard:
Short-term (recommended for demo):
Medium-term:
useRouteGuardhook that checks wallet connectivity before rendering action pages/client/listings/newshould redirect to wallet connect screen if!isConnected(currently shows a wallet prompt inline — redirect is cleaner)Long-term:
Acceptance Criteria
Priority
Low — not a correctness issue (contract enforces auth), but degrades UX.