How can I add .htpasswd with Laravel Forge for Laravel Nova?

19 Views Asked by At

I´m using Laravel 10 with Laravel Nova 4.31. For deployment / server management I use Laravel Forge.

Now I want to protect the route /nova with .htaccess/.htpasswd (= "Security Rules" in Forge). When I add a new rule for path "/nova" the route is protected by properly - I have to enter my credentials on page load and the login screen is loaded.

However, as Nova uses Inertia many requests are sent as XHR which fail due to the .htpasswd protection. For example: The login screen for nova is loaded as expected but the login doesn´t work (cause the XHR request in the background is blocked).

Is there a proper way to configure .htaccess/.htpasswd to protect the /nova route and allow XHR communication for Nova?

0

There are 0 best solutions below