Security & Login Problem

I have access problem with Security & Login
it does not work well

We need more information. ‘Does not work well’ could mean anything. What part are you having trouble with and have you followed the tutorials?

https://wappler.io/docs/#Security-and-Login

If it’s a 500 Server Error when securing a page, v1.0.5 fixes this (error in the path to the include file).

1 Like

I have a problem with security and login as well. What is new? :rofl:
I followed https://wappler.io/docs/#Setting-Site-Security-Settings and https://wappler.io/docs/#Create-Log-In-Page but when trying to login I get {“identity”:“1”}.
The login form is here: http://www.testworks.nl/content/
Username: admin
Password: admin1
No harm can be done as this is only for testing purposes

The path to App Connect js file is wrong, it is a local path - it can’t be local path… how did you insert on your page? Are you sure you worked on a page located in a site definition?

Thanks Teodor. I Always seem to surprise myself by doing things wrong. Working now

1 Like

If you create a new page and add Bootstrap/App Connect before saving the file, this is how Wappler is creating the paths - at least it is on my computer (Windows). I don’t remember this happening before the last update, but I could be wrong. If you save the file first, it’s not a problem.

1 Like

Good catch Tom!
It should fix the path as soon as you save the file. We will improve this in this week’s update.

1 Like

24 posts were split to a new topic: Static security provider not working

Hello,
I’m trying to follow this tutorial but I’m doing something wrong.

My setup is a local WAMP server with Mysql and Wappler 1.9.7, using Chrome and Firefox to test the web app.

Im following the login in tutorial on the forum, and, besides the fact that the form ‘type’ on the App Structures does not change to ‘Server Connect Form’ once I do the Step 13, which probably changed between versions, the error actually comes when submiting the form.

The Submit action itself seems to be working but I’m being taken to an URL like this
http://localhost/PROYECT_NAME/dmxConnect/api/admin/ACTION_NAME.php.

If the login was OK it shows an {“identity”:1} on the body of the action file.php, and if it was a KO then it shows an ‘Unauthorized’ text on the body.

I have added both dynamic events on the browser element, one as an alert and the other one as a redirect, but it seems to be doing nothing with it.

I have already tried this tutorial, and another that follows this exact steps (plus some cosmetics) and both end up the same.

Can someone tell me what exactly should be fixed?

Thanks

I have used the unauthorised event to send a message as in

Hi Ben,

Yes, me too, the problem is that it is not showing any alert, even tough it has been set as you did. It takes me to another PHP page, the login_action.php I created on the server actions, if the login was OK it shows the {“identity”:1} and if its not OK it shows the “Unauthorized” text.

This is how I’m configuring the alerts

And this is the form configuration

Any Ideas? I have checked the URL on the code and it seems to be pointing to the right files.

Thanks in advance for all your help

EDIT: I have tried using the go to of the browser to take it to another page and it stills behaves the same, only showing the login_action.php with the result of the query (and the query is working ok so that’s not the problem=

Have a look ate what @Hyperbytes bytes has produced https://www.youtube.com/watch?v=QnvVagY3LGM

1 Like

Manuel, i strongly recommend using the “Notifications” action in place of the browser1.alert(). If is a much cleaner solution

1 Like

Hello Hyperbytes,

Yes, Following the advice of @ben I simply started a New project (now with version 1.9.8) and followed the tutorial you made. Now it is working fine, with the notifications and the redirect to the new page on login success so, I’m not really sure what was wrong with my previous page, but luckily now it’s perfect.

Thanks to both of you.

2 Likes

Hello,

I’ve got 500 error for the login page.
And I checked the debug thing XHR, I found this message.
message: “Call to a member function login() on null”

What am I missing here?

Thanks,

It is hard to know what you have missed without seeing your code. Please start a new document and follow https://docs.wappler.io/t/login-create-a-working-user-login-page/2855 to the letter and see if you still get the error.

Hi Ben,

I have read the link you sent me above and followed each step already. Btw, I am not using bootstrap though, does it matter?

It seems that the error is coming from Security/login (login.php under dmx???folder).

Thanks,

Using Bootstrap or not makes no difference. Not seeing what you have coded, makes it difficult to give a a direct answer, hence I’ll give you a hint of where it could have gone wrong.

You must ensure that the following values are used throughout

If that is correct in your case, please give us a few relevant screen shots to work from.

Edit: It may be an idea to start a new post so that it will receive the proper attention.