Search code examples
phplaravellaravel-nova

laravel nova 403 before login in production


Essentially, in the production environment, I encounter the 403 page even before logging in (it does not even show login page). Here's how the gate function in the NovaServiceProvider is defined:

  protected function gate()
    {
        Gate::define('viewNova', function ($user) {
            return true;
        });
    }

Solution

  • So found out the cause, I had the authorize middleware there, (config/nova.php file). It was copied from a old nova version configuration I had in other project and caused this issue. Just removing it solved.

    image