This is an excerpt from Manning's book Node.js in Action, Second Edition. Login to get full access to this book.
When the user is first created, you need to set a .pass property to the user’s password. The user-saving logic then replaces the .pass property with a hash generated by using the password.