A couple of questions/help needed

Hi again,

Sorry for the posts recently, still getting used to Wappler but some things don’t seem to be documented or are a bit outdated so I’m struggling to implement them. I’m hoping I could get some help with the following:

  1. I’ve followed this tutorial but instead of using Argon2, using bcrypt, and while the signup works, whenever I attempt to login the data comes back as incorrect. I’ve double-checked all the forms, and they are correct. Is there an extra step for bcrypt that I’m missing that isn’t in the above guide? I also tried toggling “Use Password Hash Verify” just in case.

  2. I want to make my navigation bar somewhat conditional, so only certain nav lists items are displayed if 1) The user is logged in, and 2) if the user has X permission. Using server connect and a server action I am able to get the users info (for example, getuserDetails.data.query[0].admin), but how would I go about having a condition to check if this is 1 instead of 0? I did give getuserDetails.data.query[0].admin==1 a go but that didn’t seem to work.

Thanks, and thanks for the help recently, I’m very much enjoying Wappler.

Just to add, I’ve also set the password table type to binary(60), which is normally best for bcrypt instead of var(255). I’ve now also additionally tried changing the post properties just in case, but no luck, it always comes back as an incorrect login.

I set the dmy-hide (or show) attribute and check if it’s greater than 0 to decide whether to display some information or not:

<a class="nav-item nav-link" href="login.php" dmx-hide="userconnect.data.query[0].user_id>0">Login</a>

Ahh, so that’s how you do it! It’s > rather than ==, thank you, I’ll give this a try!

I’m still having issues with bcrypt described above though, so for the moment I can’t test this, but I’ll be sure to give it a try once I can.

bcrypt issue resolved! It turns out this was me confusing myself more than anything. I have both an “email” and “username” field. The login form correctly had the id and name set to “username”, but I had set the placeholder on the form to “email”, which meant I was entering the accounts email instead of user. Something to make sure I point out in the final product for end users.

All in all, this is now resolved. Thanks to @GoJoe for the tip on the navbar, I’ve also managed to get this working successfully.

1 Like

You can use == too though, if you want equals rather than greater!