towerops/lib/towerops_web
Graham McIntire e02c2d2b8f
Fix impersonation crash when session IDs are nil
Critical bug fix: fetch_current_scope_for_user and mount_current_scope
were calling Accounts.get_user(nil) when impersonating session flag was
true but superuser_id or target_user_id were nil.

This caused FunctionClauseError crashes for all logged-out users if they
had stale impersonation session data.

Changes:
- Check if both superuser_id and target_user_id exist before calling get_user
- Clear invalid impersonation state if IDs are missing
- Apply fix to both fetch_current_scope_for_user (controllers) and
  mount_current_scope (LiveViews)

This ensures graceful handling of corrupted/partial session state.
2026-01-06 13:32:17 -06:00
..
components Fix admin layout to use proper Phoenix component pattern 2026-01-06 13:04:22 -06:00
controllers Fix impersonation to show correct user data and banner 2026-01-06 13:22:13 -06:00
live Add input validation for port numbers and SNMP testing 2026-01-06 13:28:30 -06:00
endpoint.ex init 2025-12-21 11:10:43 -06:00
gettext.ex init 2025-12-21 11:10:43 -06:00
router.ex Add superuser system with user impersonation for admin support 2026-01-06 12:50:10 -06:00
telemetry.ex format 2025-12-21 11:31:08 -06:00
user_auth.ex Fix impersonation crash when session IDs are nil 2026-01-06 13:32:17 -06:00