Issue with Middleware Redirect to Login Page - JS script code/file Not Loading

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
alababdiy
Posts: 40
Joined: 30 Apr 2023, 12:46

Issue with Middleware Redirect to Login Page - JS script code/file Not Loading

Post by alababdiy » 03 Feb 2024, 11:01

Hello Aimeos community,

I hope you're all doing well. I am currently facing an issue with a Laravel middleware that redirects users to the login page if they are not authenticated. The redirection works as expected, but I've noticed that the JS script Code/files are not loading on the login.blade.php page.

Here is the relevant code from the middleware:

Code: Select all

protected function redirectTo($request)
{
    if (! $request->expectsJson()) {
        return airoute('login');
    }
}
https://github.com/aimeos/aimeos/blob/1 ... te.php#L18

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Issue with Middleware Redirect to Login Page - JS script code/file Not Loading

Post by aimeos » 05 Feb 2024, 11:15

What JS code isn't loaded? Is there a 404 in the browser console for the JS file?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply