In a NodeJS project I configured a Security Provider in Global with a static list of users and permissions
Then in the API I created a “login” action, a “logout” action and a “user” action
Thanks
Honestly I don’t know if I made the wrong configuration (which seems correct to me) or if I have to change something with static users and permissions
Thanks Teodor
A test page automatically opens the login page
If I enter the wrong credentials, the text appears and stays on the login page (and this is fine with me)
If I enter the correct credentials the result is the same
Anyway I started all over again and first of all I’d like to know how I have to modify the starting global action (scrennshoot)
Then I follow your tutorial again, but always with static users and permissions
OK Teodor
Although it would still be interesting, for a better understanding of Wappler, to know what use those rumors have, since they exist
Anyway after dinner I reconfigure the actions and see if I solve
Thanks
Teodor
I think I have followed the steps correctly, with the only variant that in the event of unauthorized entry, the login page remains (with only the warning text displayed)
The Login page provides for redirection to a specific page in case of success.
But I would like the redirect to be to the current page that requested authorization if successful.
I hope it is possible.
However, at the moment I notice an anomaly with the Login page:
If the credentials are incorrect, the alert text appears, but if the credentials are correct, the alert text still appears first and only then accepts and redirects
@Teodor
I checked point by point and now it works.
I don’t know exactly what caused the incorrect credentials message to appear even if successful.
Perhaps in the code the Success event was placed after the Unauthorized event
However I can’t get what I want:
First of all, in case of success, I would like the redirect not to lead to a defined page, but to the current page that caused the request for credentials
Then I would like that in the Menu (NavBar - Layout page) it was possible to insert the “login” link or the “logout” link according to the status
Being NodeJS I would like to know if it is possible
Thanks
Maybe I expressed myself badly.
If I remove the redirect after success, the Login page remains.
I would like him instead to return to the page that caused the login request