Improved Auto Routing not working with AJAX request |
Just started a new project with CodeIgniter and after installation with composer I noticed the following warning in Routes.php:
Code: // The Auto Routing (Legacy) is very dangerous. It is easy to create vulnerable apps... So following the suggestion I set: Code: $routes->setAutoRoute(true); Code: public bool $autoRoutesImproved = true; The default route in Routes.php: Code: $routes->get('/', 'Authentication::index'); This is my controller: PHP Code: class Authentication extends BaseController { When I go to http://localhost:8080 it loads the login page as it should. I perform an AJAX request on form submit to verify the user credentials so that the latter can log in; but I am getting 404 on the following URL: http://localhost:8080/authentication/login This is the AJAX request: Code: pageLoginForm.on('submit', function(e) { I added the prefix "post" to my controller method as instructed by the documentation but it's not working. Am I missing something? |
Messages In This Thread |
Improved Auto Routing not working with AJAX request - by jolan.goburdhun - 08-19-2022, 01:32 PM
|