AWS Docker Nodejs URL Redirect After Login Issue

I have a local development and a AWS Docker production site using Nodejs.

On the local development, I have set up a URL redirect after login that contains the query for the page that the user was on prior to login. This is working as intended.

On the AWS Docker production site, the URL redirect after login with the query of the page that the user was on prior to login is not working as intended.

No matter which page a user was on prior to login, the URL Query parameter is switched from the what it should be to /login?url=/login which causes a an ERR_TOO_MANY_REDIRECTS error.

I have tried to publish the site several times. I did a shutdown and clear services of the AWS Docker as well without success.

Since it is working on the local development, I feel it should be working on the AWS Docker production site as well.

To provide more context,

Here is how the security restrict is structured:

Screenshot 2024-04-29 at 4.37.16 AM

On the layout page (not the content page), here is how it is structured:

Screenshot 2024-04-29 at 4.41.49 AM

Sounds like somehow you are looping back and forward in an infinite loop.
What happens if you remove the parameter from the enforcer, do you still get the error?

Have you viewed this?

I removed the query parameter from the server action and published the site, but the change did not take effect. The original error persists.

Screenshot 2024-04-29 at 5.41.37 AM

May be a silly question, you don’t have a security restrict on the layout used by the login page?

Not a silly question at all. I thought about that initially and checked to make sure I had not goofed.

But no, the login page has nothing in the server side data.

Sorry think am out of ideas. Not an AWS/docker user so if it is server related I am unable to help.
All I can think of is that the login credentials are somehow not being stored so login is successful but when redirected they are not detected/ have been lost and redirection happens again.

Not sure if that is the issue to be honest. When I login, it redirects to the dashboard page and that is where the error occurs. But if I go to the home page, which is not secured, it shows my first name and the logout button. So, it would appear that the login credentials are being maintained. When I take the security off the dashboard page, it shows normally with my first name as well.

When I apply a different security using a different permission group to any other page, the error occurs as well.

I feel like something has not been uploaded, but I am unsure what it could be. Since it is docker, I am not sure how to force the publishing of all files. I have tried publishing of course, deploy as well, I even did a shutdown and clear all services (after backing up the database).

It is my understanding with docker that what you see on the local side of things should mirror the remote docker side of things, so that is why I am confused as well.

How is your security provider set up? If user login is correct maybe the permissions are the problem?

What if you remove the permissions from the security enforcer to allow any user to to view. Does that work?

The three table method: users table, roles table, join table.

OMG! I just figured it out!!! Thanks @Hyperbytes for the tip!

In my local development, I have the database set up through the Resource Manager. When I publish the site, the local data is not being transferred to the remote server. As a result, while I had given my user roles on the local site, they were non-existent on the remote side.

I did a data export and import using MySQL Workbench and it works as intended now. That did bring up a different issue about why the “Save Database Structure and Data” button does not work when using the Resource Manager, but that’s an issue for a different topic (after I search to see if it has been reported before).

Sorry to have wasted your time @Hyperbytes. This is definitely an issue on my side. :slight_smile:

1 Like

No problem, pleased to help

1 Like