Interface: PasswordCreationServiceInterface
Password Creation Service Interface
Properties
Property | Type | Description |
---|---|---|
validateCurrent | (options : Partial <PasswordCurrentPasswordInterface >) => Promise <boolean > | Validate the current password for the targeted object. |
validateHistory | (options : Partial <PasswordHistoryPasswordInterface >) => Promise <boolean > | Validate the array of password stores to check for previous usage. |
Methods
checkAttempt()
checkAttempt(
numOfAttempts
):boolean
Check if attempt is valid.
Parameters
Parameter | Type |
---|---|
numOfAttempts | number |
Returns
boolean
Number of attempts user has to try
Defined in
checkAttemptLeft()
checkAttemptLeft(
numOfAttempts
):number
Check number of attempts of using password
Parameters
Parameter | Type | Description |
---|---|---|
numOfAttempts | number | number of attempts |
Returns
number
number of attempts left
Defined in
createObject()
createObject<
T
>(object
,options
?):Promise
<Omit
<T
,"password"
> |Omit
<T
,"password"
> &PasswordStorageInterface
>
Create password for an object (optionally).
Type Parameters
Type Parameter |
---|
T extends PasswordPlainInterface |
Parameters
Parameter | Type | Description |
---|---|---|
object | T | An object containing the new password to hash. |
options ? | PasswordCreateObjectOptionsInterface | Password create options. |
Returns
Promise
<Omit
<T
, "password"
> | Omit
<T
, "password"
> & PasswordStorageInterface
>
A new object with the password hashed, with salt added.