API Reference
Rockets Core API
nestjs-password
interfaces
PasswordStorageServiceInterface

Interface: PasswordStorageServiceInterface

Password Storage Service Interface

Methods

generateSalt()

generateSalt(): Promise<string>

Generate salt to be used to hash a password.

Returns

Promise<string>

Defined in

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


hash()

hash(password, options?): Promise<PasswordStorageInterface>

Hash a password using a salt, if no was passed, then generate one automatically.

Parameters

ParameterTypeDescription
passwordstringPassword to be hashed
options?PasswordHashOptionsInterfaceHash options

Returns

Promise<PasswordStorageInterface>

Defined in

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


hashObject()

hashObject<T>(object, options?): Promise<Omit<T, "password"> | Omit<T, "password"> & PasswordStorageInterface>

Hash password for an object.

Type Parameters

Type Parameter
T extends PasswordPlainInterface

Parameters

ParameterTypeDescription
objectTAn object containing the new password to hash.
options?PasswordHashObjectOptionsInterfaceHash object 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-storage-service.interface.ts:34 (opens in a new tab)