diff --git a/basics/features/password.md b/basics/features/password.md index 2b8be1f..6843a66 100644 --- a/basics/features/password.md +++ b/basics/features/password.md @@ -4,15 +4,15 @@ description: '@adminjs/passwords' # Password -The password feature can be utilized to hash a user's password when editing it's record. +The password feature can be utilized to hash a user's password when editing its record. -Installation +## Installation ```shell $ yarn add @adminjs/passwords ``` -Next step is to add feature option to user resource +Next step is to add the feature option to the user resource: ```javascript import argon2 from 'argon2'; @@ -26,7 +26,7 @@ const adminJsOptions = { { resource: User, options: { - //...your regular options go here' + //...your regular options go here properties: { password: { isVisible: false } }, }, features: [ @@ -34,15 +34,15 @@ const adminJsOptions = { componentLoader, properties: { encryptedPassword: 'password', - password: 'newPassword' - } + password: 'newPassword', + }, hash: argon2.hash, - }) + }) ] }, ], //... -} +}; ``` -In the example above `password` is `User` property which holds encrypted password (we have to make it invisible to keep secure. `newPassword` in `passwordsFeature -> options` properties is a virtual field which keeps entered password and will be hashed before saving. +In the example above, `password` is the `User` property which holds the encrypted password (we have to make it invisible to keep it secure). `newPassword` in `passwordsFeature` -> `properties` is a virtual field which keeps the entered password and will be hashed before saving.