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. |
||
|---|---|---|
| .. | ||
| towerops | ||
| towerops_web | ||
| towerops.ex | ||
| towerops_web.ex | ||