Additional context
Here are some logs from laravel.log file:
[2024-05-08 11:05:34] production.ERROR: App\Policies\ServerPolicy::viewAny(): Argument #2 ($project) must be of type App\Models\Project, null given, called in /home/vito/vito/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php on line 811 {"userId":4,"exception":"[object] (TypeError(code: 0): App\Policies\ServerPolicy::viewAny(): Argument #2 ($project) must be of type App\Models\Project, null given, called in /home/vito/vito/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php on line 811 at /home/vito/vito/app/Policies/ServerPolicy.php:12)
[stacktrace]
Describe the bug After you create a new user, add a project and try to login you get 500 | Server error
To Reproduce Steps to reproduce the behavior:
Expected behavior User should be able to login.
How you skip the 500 Server error
Screenshots
Additional context Here are some logs from laravel.log file: [2024-05-08 11:05:34] production.ERROR: App\Policies\ServerPolicy::viewAny(): Argument #2 ($project) must be of type App\Models\Project, null given, called in /home/vito/vito/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php on line 811 {"userId":4,"exception":"[object] (TypeError(code: 0): App\Policies\ServerPolicy::viewAny(): Argument #2 ($project) must be of type App\Models\Project, null given, called in /home/vito/vito/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php on line 811 at /home/vito/vito/app/Policies/ServerPolicy.php:12) [stacktrace]