Redirect not working

PHP project

I have a page called dashboard with a security enforcer enabled.
Not logged in it it set to login.php. This page works. If you visit the page directly it takes you to the login.php.

I have another page called tickets, which has a route of /tickets/:ticket accepting a parameter. If you visit the http://url/ticket/1177 (which is an actual ticket) you get what looks like a forever loop of trying to redirect to login.

If i visit the ticket page with ticket.php?ticket=1177, it redirects correctly. So there is something broken or wrong with my routes. But i can’t find it.

You don’t have a security enforcer set on your login page do you?

1 Like

No security enforcer on the login page. Else it wouldn’t work from the dashboard.

Think we need to see your sever action and your page dynamic actions on success or we would just be guessing

Just checking, when you say, not logged in is set to login.php you do mean here on your page

image

and not her on your API action

image

Here’s the security enforcement for dashboard.php, which works. NOtice it’s simply pointo to a php file, login.php.
image

I have a route for login, which is just /login and points to login.php. So on the page it is NOT working this is what is there:
image

the Login page is just a login page, with a form and an action to a login api, that does not have any restrict. If it, this wouldn’t work from the dashboard.php page either.

May be wrong but I seem to recollect the security restrict does not support routes

I’ve changed the enforcer to login.php instead of the route.