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

Nova session logged out results in modal iframe login view #6508

Closed
matthewjumpsoffbuildings opened this issue Aug 22, 2024 · 2 comments
Closed
Labels
needs more info More information is required

Comments

@matthewjumpsoffbuildings
  • Laravel Version: 10.48.20
  • Nova Version: 4.35.0
  • PHP Version: 8.3.4
  • Database Driver & Version: MySQL
  • Operating System and Version: macOS 14.5
  • Browser type and version: Chrome 127.0.6533.120

Description:

When I am logged into Nova, and then I clear my application data in the dev tools (eg my cookies, session, local storage etc), as soon as I then try and interact with the Nova interface, eg clicking a resource, instead of getting redirected to the login page, I get a modal dialogue with an iframe of the login page inside it.

This modal dialogue iframe then redirects to the Nova application, still inside the modal dialogue, over top of the old Nova interface.

This same modal iframe behaviour occurs if the logged in users sessions times out for other reasons, eg not just if I manually delete the session/cookies from the dev tools

@crynobone
Copy link
Member

Unable to reproduce the issue, please provide full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example)


We already following the recommended structure by Inertia and are unable to replicate this: https://inertiajs.com/error-handling

@crynobone crynobone added the needs more info More information is required label Aug 22, 2024
@matthewjumpsoffbuildings
Copy link
Author

I have found the root cause.

In the api_middleware stack in config/nova.php we were using the auth middleware from our App\Http\Middleware folder

eg

'api_middleware' => [
		'nova',
		'auth',
		Authorize::class,
	],

When I restored the Nova Authenticate middleware, eg

'api_middleware' => [
		'nova',
		Authenticate::class,
		Authorize::class,
	],

The issue stopped occuring. I think it has something to do with the fact that the Nova Authenticate middleware throws a NovaAuthenticationException wheras the base Authenticate middleware throws an AuthenticationException

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info More information is required
Projects
None yet
Development

No branches or pull requests

2 participants