1 Commits

Author SHA1 Message Date
66316328bb Fix seeder emails to match LDAP mail attributes
All checks were successful
linter / quality (pull_request) Successful in 1m27s
security / Dependency Audit (pull_request) Successful in 2m20s
security / Static Analysis (pull_request) Successful in 1m50s
tests / ci (8.4) (pull_request) Successful in 1m33s
tests / ci (8.5) (pull_request) Successful in 2m5s
Seeded user emails were using example.com domains which don't match
the LDAP mail attributes (travel.local). When users log in via LDAP,
LdapRecord syncs by email — a mismatch caused new DB records to be
created without roles, preventing admin access to the Filament panel.
2026-03-06 07:11:08 +00:00
3 changed files with 8 additions and 8 deletions

View File

@@ -16,28 +16,28 @@ class DatabaseSeeder extends Seeder
// Create roles // Create roles
$this->call(RoleSeeder::class); $this->call(RoleSeeder::class);
// Create admin user // Create admin user — email matches LDAP mail attribute
$admin = User::factory()->create([ $admin = User::factory()->create([
'name' => 'Administrator', 'name' => 'Administrator',
'email' => 'admin@example.com', 'email' => 'admin@travel.local',
'username' => 'admin', 'username' => 'admin',
'password' => Hash::make('password'), 'password' => Hash::make('password'),
]); ]);
$admin->assignRole('administrator'); $admin->assignRole('administrator');
// Create a travel approver // Create a travel approver — email matches LDAP mail attribute
$approver = User::factory()->create([ $approver = User::factory()->create([
'name' => 'Travel Approver', 'name' => 'Travel Approver',
'email' => 'approver@example.com', 'email' => 'approver@travel.local',
'username' => 'approver', 'username' => 'approver',
'password' => Hash::make('password'), 'password' => Hash::make('password'),
]); ]);
$approver->assignRole('travel_approver'); $approver->assignRole('travel_approver');
// Create a staff user // Create a staff user — email matches LDAP mail attribute
$staff = User::factory()->create([ $staff = User::factory()->create([
'name' => 'Staff Member', 'name' => 'Staff Member',
'email' => 'staff@example.com', 'email' => 'staff@travel.local',
'username' => 'staff', 'username' => 'staff',
'password' => Hash::make('password'), 'password' => Hash::make('password'),
]); ]);

View File

@@ -1,6 +1,6 @@
<!doctype html> <!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"
x-data="{ theme: localStorage.getItem('theme') || 'dark' }" x-data="{ theme: localStorage.getItem('theme') || 'light' }"
x-init="$watch('theme', val => { document.documentElement.setAttribute('data-bs-theme', val); localStorage.setItem('theme', val); }); document.documentElement.setAttribute('data-bs-theme', theme);" x-init="$watch('theme', val => { document.documentElement.setAttribute('data-bs-theme', val); localStorage.setItem('theme', val); }); document.documentElement.setAttribute('data-bs-theme', theme);"
:data-bs-theme="theme" :data-bs-theme="theme"
> >

View File

@@ -1,6 +1,6 @@
<!doctype html> <!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"
x-data="{ theme: localStorage.getItem('theme') || 'dark' }" x-data="{ theme: localStorage.getItem('theme') || 'light' }"
x-init="document.documentElement.setAttribute('data-bs-theme', theme);" x-init="document.documentElement.setAttribute('data-bs-theme', theme);"
:data-bs-theme="theme" :data-bs-theme="theme"
> >