API Reference
Rockets Core API
nestjs-password
interfaces
PasswordCreationServiceInterface

Interface: PasswordCreationServiceInterface

Password Creation Service Interface

Properties

PropertyTypeDescription
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

ParameterType
numOfAttemptsnumber

Returns

boolean

Number of attempts user has to try

Defined in

packages/nestjs-password/src/interfaces/password-creation-service.interface.ts:50 (opens in a new tab)


checkAttemptLeft()

checkAttemptLeft(numOfAttempts): number

Check number of attempts of using password

Parameters

ParameterTypeDescription
numOfAttemptsnumbernumber of attempts

Returns

number

number of attempts left

Defined in

packages/nestjs-password/src/interfaces/password-creation-service.interface.ts:58 (opens in a new tab)


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

ParameterTypeDescription
objectTAn object containing the new password to hash.
options?PasswordCreateObjectOptionsInterfacePassword create options.

Returns

Promise<Omit<T, "password"> | Omit<T, "password"> & PasswordStorageInterface>

A new object with the password hashed, with salt added.

Defined in

packages/nestjs-password/src/interfaces/password-creation-service.interface.ts:18 (opens in a new tab)