Texts (password) compare
Hi there, that's my first time with Xano, but I already made a few different APIs.
Now I'm facing a strange issue with one of them.
Actually, I made a simple "reset-passord" which get three inputs: user id (id of the user to update), password and retype_password.
I made a "pre-condition" comparing theese two inputs to check if they are the same beofre storing them on the realtive user.
It seems never pass it. I also tried to compare them with a simple =. But nothing works again.
Any tip would be appreciated.
Comments
-
Is the password of type 'password' field in Xano?
If so then you will probably need to use the Check Password function
Which is in the Security drawer
I suggest that you take a look at the default /auth/login endpoint provided by Xano to see how it is used.
-
Ok, I checked that out and also I checked my inputs which is both type text.
So, I think it should simply compare two strings.
Also the check password function(validate password) I think it "encode" the plain text password and compare with the stored one.
In my case I need just to compare two plain texts before store it (the new password).
That would be essentially a "change password" api!
-
I changed the inputs with the type password. I'm trying also with validate password but still not works.
-
If both values are plain text then skip the filter of 'equals' and do
password = retype_password
-
@daniele.dagostino the Check (Validate) Password function is to check an existing password (stored in the database aka hashed password) against an inputted text password.
What you want to do for your use-case is use a Precondition
WHERE text: password = text: retype_password
Preconditions enforce something must be true and will throw and error if they are not true,
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback