Skip to content

merged the citizen and officer dashboard without the login - #13

Open
ClickCopyPaste wants to merge 8 commits into
devfrom
dev-ahkash
Open

merged the citizen and officer dashboard without the login#13
ClickCopyPaste wants to merge 8 commits into
devfrom
dev-ahkash

Conversation

@ClickCopyPaste

Copy link
Copy Markdown
Collaborator

No description provided.

pratheeka-thushyanthan and others added 8 commits August 1, 2026 17:46
…cle Carousel, Registry, Shared Vehicles) into CitizenPortal tabs
…tch, remove login

Merges dev-ahkash (roadside penalty citation module) onto dev and resolves the
integration problems that accumulated during the earlier merge attempts.

Officer/citizen switching
- An officer is also a citizen, so both portals are reachable from one session.
  Dashboard gains "My Citizen Portal", CitizenPortal gains "Officer Dashboard".
- App.jsx routes on the active persona and remounts the portal on a switch, so
  no vehicles, citations or notifications leak between users.

Login removed (being rebuilt separately)
- Deleted Login.jsx, AuthController, LoginRequest, and the orphaned duplicate
  auth stack (JwtService, JwtAuthenticationFilter, JwtAuthFilter) that pointed
  at a SecurityConfig which no longer existed.
- Added DevIdentityFilter: resolves identity from an X-User-Nic header and loads
  the user's real role from the database. Every SecurityContextHolder call in
  the 8 controllers and every authority rule in SecurityConfig keeps working
  unchanged, so the login rebuild is a one-file swap.
- Kept JwtUtils: the 5-minute enforcement session token is the citation privacy
  lockout, not login, and must survive.

Single identity source
- Added identity.js. The Registry tab previously read a hardcoded persona NIC
  while the Citations tab read the JWT, so an officer switching to their citizen
  portal saw another citizen's vehicles. Both now read the same persona.
- Moved PersonaSwitcherBar to App level so it is reachable from every portal
  (selecting the admin persona previously stranded you in AdminPortal).
- services/api.js no longer auto-logs-in with a hardcoded password.

Role cleanup
- Role had six constants for three logical roles, forcing every check to
  enumerate all of them. Added toAuthority()/isLawEnforcement(); legacy
  spellings are kept deprecated for DB compatibility only.

Port fixes (per portmap.txt)
- server.port 8081 -> 8085; 8081 is the DRP mock API container.
- gov.drp 8082 -> 8081 and gov.dmt 8083 -> 8082; both were off by one slot,
  with gov.dmt pointing at phpMyAdmin.
- frontend api.js 8081 -> 8085; it was calling the DRP mock, not the backend.
- jwt.5min.expiration was 31536000000 (1 year), not 5 minutes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants