t11
November 3, 2018, 12:25pm
1
This was implemented in DW version but the same goes for Wappler.
We insert user in the database (when he subscribes).
We get current user’s data.
We create a repeat using the query created in step 2 as an expression.
We add the security provider.
Using the ‘security login’ as values to validate those coming from the repeat.
If the data is valid, you can whatever you want (create query, redirect etc).
Step 2
In the filter just use the identity of the ‘insert in step 1’ to get the username and password.
Step 3
In the repeat just use as an expression query created in ‘step 2’ and output ‘username’ and ‘password’ so you can use them inside the repeat.
Step 4
In the ‘security login’ just use the ‘username’ and ‘password’ coming from the repeat.
If user is valid (which will be since Server action has executed successfully and has reached this step) he will be logged in.
After logging in just do whatever you want. Add another query, or just redirect him using the ‘onsuccess’ dynamic event.
5 Likes
Emiel
May 17, 2020, 9:56am
6
For anyone trying to achieve this, have a look at this method and let me know what you think:
I have been trying to make this work for a while and finally came up with these server action steps to register and auto login users:
Database connection
Database insert: register_user (insert options: $_POST.username & $_POST.password.passwordHash… etc)
Security Provider
Security Login ($_POST.username & $_POST.password)
Passwords are hashed with Argon2id and all happens in one server action file, so it must be secure, right? Advantage of this method is that the repeat and get_registered_use…
Does anyone knows where can find create a user registration with Wappler UI. sorry, it’s very confusing to follow steps using different UI.
This topic is 3 years old.
You can check our youtube channel for tutorials like this
VIDEO
1 Like
Thank you for the video information.
Just a suggestion, better if you delete this info from docs, and replace it with a video that you just share.
However, I personally prefer reading written documentation rather than watching video tutorials.