2026-05-09 Consultant Release And External Auth Cleanup
Documented the removal of local username/password management, consultant release export on user deletion, and null-safe consultant handling across customers, projects, and the buy flow.
2026-05-09 Consultant Release And External Auth Cleanup
This change updates user lifecycle handling to match the current authentication model and prevents customer or project records from breaking when a consultant account is deleted.
Summary
- Removed local
usernameandpasswordmanagement from the Filament user admin UI. - Kept legacy database compatibility by auto-filling those columns during user creation until the schema is cleaned up.
- Added user deletion handling that exports consultant ownership data before releasing assignments.
- Released
consultant_idrelationships from both customers and projects when a user is deleted. - Updated customer portal and notification flows to tolerate
consultant_id = nullwithout throwing 500 errors.
Why This Change Exists
Tempr now relies on an external auth server for user authentication. Keeping editable local credentials in the admin UI was misleading and created a maintenance path that no longer reflects how access is granted.
At the same time, user deletion previously conflicted with consultant ownership. Because users are soft-deleted, database-level nullOnDelete() behavior does not run automatically, which left stale consultant_id references behind. Those stale references could trigger runtime errors anywhere the app assumed $customer->consultant or $project->consultant always resolved.
Behavior Changes
User administration
- The user admin form no longer exposes
usernameorpassword. - User creation still succeeds against the current schema because the model backfills:
usernamefromemailpasswordwith a random hashed value
This preserves compatibility while making it clear that local credentials are not part of the supported workflow.
User deletion
When a user is deleted:
- The app gathers all customers assigned through
customers.consultant_id. - The app gathers all projects assigned through
projects.consultant_id. - It writes an export file to:
storage/app/exports/consultant-releases/
- It sets
consultant_idtonullon both customers and projects. - It stores the export path and release counts in the deleted user's
metapayload.
This gives operations a durable record of what was released before those relationships were cleared.
Customer portal and buy flow
The customer-facing proposal and buy-flow views now use fallback branding and contact details when no consultant is assigned. That prevents deleted consultants from causing portal rendering failures.
Fallback behavior currently uses:
- Name:
Shades of Texas - Email:
support@shadesoftx.com - Avatar:
/logo/cust/sot_logo.png
Files And Areas Updated
app/Models/User.phpapp/Observers/UserObserver.phpapp/Support/Users/ReleaseConsultantAssignments.phpapp/Providers/EventServiceProvider.phpapp/Filament/Resources/Users/UserResource.phpapp/Http/Controllers/Customer/LeadRouterController.phpresources/views/livewire/customer-portal/v3/proposal-sidebar.blade.php- supporting notification and reporting paths that previously assumed a consultant always existed
Operational Notes
- Customer and project records can now remain valid after consultant deletion.
- Any code that displays consultant information should continue using null-safe accessors or explicit fallbacks.
- The export file is written before assignments are released, so it can be used for reassignment audits or manual follow-up.
Verification
Covered by targeted feature tests:
tests/Feature/Users/UserDeletionReleasesConsultantAssignmentsTest.phptests/Feature/CustomerPortal/ProposalViewingTest.php