Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403 error when using two subdomains #6674

Closed
ricardomartos opened this issue Jan 16, 2025 · 3 comments
Closed

403 error when using two subdomains #6674

ricardomartos opened this issue Jan 16, 2025 · 3 comments

Comments

@ricardomartos
Copy link

  • Laravel Version: 11.38.2
  • Nova Version: 4.35.5
  • PHP Version: 8.3.6
  • Database Driver & Version: PostgreSQL 15
  • Operating System and Version: Ubuntu 24.04.1
  • Browser type and version: Brave 1.73.105

Description:

When using multiple subDomains ( subDomain1.subDomain2.domain.com ) I can access the nova dashboard when in development/production model of the app.
My license key has the "domain.com" domain (I can't put the real domain for legal reasons)

php artisan nova:check-license displays on development and production mode:

Your license key is valid and correctly configured! Thank you for being a Nova customer. 🚀

APP_ENV=development a license key tagged development, doesn't works

APP_ENV=production with the main license key, doesn't works

The server is using dev.xxxxxx.domain.com

I'm using the provided Nova Gate:

protected function gate() { Gate::define('viewNova', function ($user) { return in_array($user->email, [ 'user@domain.com' ]); }); }

Being the email a valid user email in the DB.

If I switch to APP_ENV=local , it works (of course)

That's all info I can provide publicly.

@crynobone
Copy link
Member

  1. License key has zero affect on 403 error. It is only used to display Unregistered state.
  2. local environment does check NovaServiceProvider::gate() configuration while other environment does.

What's the output when production environment with the correct gate() configuration?

@ricardomartos
Copy link
Author

when Bypassing the gate, returns the same 403.

Gate::define('viewNova', function () { return true; });

@ricardomartos
Copy link
Author

I got it to work, in my nova config I had an extra entry on one of the options, residual code from old refactoring.

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants