Adding the minLegnth option in signup.js like in this exemple :
password:{required:true,type:'string',minLength:6,maxLength:200,example:'passwordlol',description:'The unencrypted password to use for the new account.'},
Make the signup page generating an error and dont triggered the error on the password input.
This is the same with the regex so if i want a user to have a strong password this is apparently not the way to do it.
Did the validation of the form need to be activated somewhere or maybe a miss something in the doc ?
Definately using statusCode for my toaster app :) I am loving how SailsJS have this broad aproach.
How would I make an ajax form in the view to correspond with an upload?
How do you search all folders at once
I have tried with bootstrap.js to try new user but it isn't working. No new user is inserting into DB
did you restart the app ?
@dhruv-mishra
restarting would not have an effect
@jayant
bootstrap.js does not rebuild on every lift. The following comments in the bootstrap.js file more clearly describe the behavior:
// Whether or not to continue doing the stuff in this file (i.e. wiping and regenerating data)// depends on some factors:// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// If the hard-coded data version has been incremented, or we're being forced// (i.e. `--drop` or `--environment=test` was set), then run the meat of this// bootstrap script to wipe all existing data and rebuild hard-coded data.
That suggests you should drop the existing data and rebuild from bootstrap. So if you're fine with starting from scratch:
1. add the new user to the bootstrap
bootstrap.js
// By convention, this is a good place to set up fake data during development.awaitUser.createEach([{emailAddress:'admin@example.com',fullName:'Ryan Dahl',isSuperAdmin:true,password:await sails.helpers.passwords.hashPassword('abc123')},{emailAddress:'newuser@example.com',fullName:'New User',isSuperAdmin:false,password:await sails.helpers.passwords.hashPassword('abc123')},]);
I add "New User" as an element to the array passed to createEach. I believe you could use separate away User.createEach() calls if you so determined. I believe you got this far based on your comment.
2. Drop the existing data and rebuild
Warning: Performing the following will clear out your existing data
From the command line:
sails console --drop
3. Verify your updates
Still in the console, you can verify that your new user is created:
User.find().log()
Note: await User.find() is not yet available as remarked in a previous video. The User.find().log() is still required. Though, perhaps Mike had a better idea for how await User.find() might be used (in conjunction with an async function?
Here is the output of the above. Notice the id: 5. My database had a few other users before dropping, suggesting that the database wasn't recreated, only the data was deleted and reinserted. If you issue multipe --drop you will notice it also increment; you only need to do it once.
password:{required:true,type:'string',minLength:6,maxLength:200,example:'passwordlol',description:'The unencrypted password to use for the new account.'},
Make the signup page not working and dont triggered the error on the page.
Did the validation of the form need to be activated somewhere or maybe a miss something in the doc ?
Primer comentario aqui, jaja, he estado practicando en este curso, pero busco independencia de cada una de las vistas :(((