Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

zagreus's avatar

Auth (with Nova) not working on Forge

Hey everyone,

I've deployed my Nova app (which works on my local environment) to Forge and cannot log in. There is no error, the user is just redirected back to the login form.

My nova installation is behind a load balancer

Things I've tried:

  1. Changing the Session driver to cookie
  2. Checked the permissions on the storage folder - a session is created in storage/framework/sessions when I click the remember me option on the form
  3. The user definitely exists, I have checked with tinker and I have also checked the password with Hash::check

So, hmmm, I'm stuck. Any suggestions would be much appreciated.

Thanks!

0 likes
3 replies
aurawindsurfing's avatar
Level 50

Hi @zagreus

This is not forge related issue.

Nova is by default disabled in production:

https://nova.laravel.com/docs/1.0/installation.html#authorizing-nova

Authorizing Nova Within your app/Providers/NovaServiceProvider.php file, there is a gate method. This authorization gate controls access to Nova in non-local environments. By default, any user can access the Nova dashboard when the current application environment is local. You are free to modify this gate as needed to restrict access to your Nova installation:

/**
 * Register the Nova gate.
 *
 * This gate determines who can access Nova in non-local environments.
 *
 * @return void
 */
protected function gate()
{
    Gate::define('viewNova', function ($user) {
        return in_array($user->email, [
            '[email protected]',
        ]);
    });
}

Hope it helps!

zagreus's avatar

Wow do I feel stupid. I just did this on a different project and I completely forgot about it!

Thank you @aurawindsurfing !

zagreus's avatar

BTW - just a quick note for anyone else looking here. When you're setting your trusted proxies make sure that you're setting the internal IP address of your load balancer (the one that the app server will receive the traffic from) not the public one.

Please or to participate in this conversation.