Security Restrict results in 404 Error

Wappler Version : 3.5.4
Operating System : Mac Big Sur
Server Model: Nodejs
Database Type: mysql
Hosting Type: Local Docker

Expected behavior

Security restrict should restrict access to the page as outlined in

Actual behavior

A 404 error is generated.

How to reproduce

  1. Follow the steps in the tutorial linked above.

When the server connect action is removed from the App Connect < App on the right hand side, the page works as normal, except it is not restricted.

Has anyone been able to recreate this? Or am I doing something wrong?

What do you think @Teodor? Am I doing something wrong or is this a bug?

Scott - I’m able to reproduce this and it happens to me as well on any page I try to add Security Restrict on.

Did you happen to get an update from Patrick?

I’m not sure if this is on the right track or if I have something configured incorrectly but I found a way to get it to, sort of, work. Apparently it only works for me if the pages are in the root folder and anything located in a subfolder will fail to locate. Also, when choosing the Login URL from the file picker in the Restrict Properties, you have to remove the .ejs extension in order for it to find and redirect to the correct file.

You can’t use security restrict with NodeJS pages.
Please check:

That’s the exact page I’m following to set it up. The security restrict I’m referring to is in the server side server action as per the instructions on the link you provided.

What I’ve noticed is that when adding the server action to the server side data on the page itself it adds an incorrect link in routes.json. It appends “app//…” to the “exec” attribute which is causing the 404 errors. If I remove the “app//…” and just leave it pointed to “/api/”{path} then it works as expect.

The error for nested folders is that the route generation is incorrect and you manually have to edit routes any time the page is changed to remove the “app//…” from exec.

I am not quite sure i understand the issue.
Can you please share a few screenshots showing where your files are located, what do you select and how and what is generated exactly?

I hope this helps and sorry for not being clearer!

Various folders for pages:

Properties on the page

routes.json after saving.

Error from Web Server

Removing “/…” from routes.json corrects the issue but any change to the page causes the route to revert back.

Thanks, it’s clear now :slight_smile: we are checking the issue.

1 Like

Will be fixed in the next update

Fixed in Wappler 3.7.1

1 Like

Thank you for the quick fix!

This topic was automatically closed after 46 hours. New replies are no longer allowed.