towerops/lib
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
..
towerops Add dialyzer type specs to refactored functions 2026-01-06 13:12:55 -06:00
towerops_web Fix impersonation crash when session IDs are nil 2026-01-06 13:32:17 -06:00
towerops.ex init 2025-12-21 11:10:43 -06:00
towerops_web.ex format 2025-12-21 11:31:08 -06:00