I’m trying to use the package ‘joi-password-complexity’ to validate password in users.js for the vidly app. It’s not working. I tried some solutions but without success. There is no much documentation on how to use it with an old version of Joi.
I’d like to know if is there someone that has already successfully tried to use it. TIA
here is my validateUser function in the module vidly\models\user.js:
Thank you for your reply.
But I don’t agree with you: I don’t think that some code is bad only because I don’t know how to use it correctly
If you look in ‘node_modules\joi-password-complexity’ you can see the actual code in use. Moreover in README.md are specified the Requirements So it’s likely that this is not working only because I’m using an old version of Joi. When I will finish my course I will come back and update Joi. For the moment I thank you for you effort. sorry if I caused you a bad moment
The code exported the extension wrapped in a function that can be used in the way the read-me file shows. It supposed to export the extension and extend the Joi class.
And I installed the newest version of Joi and I also failed to use it as an extension, so it’s not the matter of Joi version.
And don’t worry, I’m just joking with memes. “and my day is ruined” is a meme phrase and I’m always happy to help people with questions ;).
Ok thank you for your precisation. thank you for your addon.
For now I will freeze it in a vault. Otherwise I am going to lose other time struggling with it an entire day
If I solve it I will update this post.
P.S.
By the way if you search on the web, there was an answer in the old forum but Mosh staff didn’t save the old forum
and so all those precious information were lost
I also searched in web-archive but no trace at all of that, last and unique saving was in August.
Wow . Great discover!! Thank you very much
Even if for this specific problem there are not any other solutions that I have not already tried
It will be useful for other issues.
P.S.
I’m downloading and saving for future all the old pages of the forum cached in Google Search
If you find anything especially valuable feel free to repost it here in the respective category.
Since you are processing all post maybe you will find out what the FAQ are and repost them with the best answers? That may help new users and can be a good starting point for sticky or wiki posts as soon as anyone of us gains the privileges to make posts sticky or wiki posts.
It could be a good idea.
I’d like to give my contribute to the community sharing those info but it would be a time-wasting activity without a specific request. And I don’t like post something that I didn’t checked before
If I experienced some issue that I can solve only in the old forum pages , then I will certainly post the solution here
For your other request, sadly I haven’t find yet any old page with the FAQ list.
SOLVED.
My code didn’t work because I didn’t install the right version of joi-password-complexity
With the version available at the time of recording video (with all the requirements currently installed on my environment, the same of the course) the package “Joi-password-complexity” can be used as in the following code.
First I installed npm i joi-password-complexity@2.0.1
In the user module on the top I imported the package: const passwordComplexity = require("joi-password-complexity");