lib/auth/password
Functions
'Read the “', Functions, '” section'hashPassword()
'Read the “', hashPassword(), '” section'function hashPassword(password: string): Promise<string>
Defined in: studiocms/packages/studiocms/src/lib/auth/password.ts:46
Hashes a plain text password using bcrypt.
Parameters
'Read the “', Parameters, '” section'string
The plain text password to hash.
Promise
<string
>
A promise that resolves to the hashed password.
verifyPasswordHash()
'Read the “', verifyPasswordHash(), '” section'function verifyPasswordHash(hash: string, password: string): Promise<boolean>
Defined in: studiocms/packages/studiocms/src/lib/auth/password.ts:58
Verifies if the provided password matches the hashed password.
Parameters
'Read the “', Parameters, '” section'string
The hashed password to compare against.
string
The plain text password to verify.
Promise
<boolean
>
A promise that resolves to a boolean indicating whether the password matches the hash.
verifyPasswordStrength()
'Read the “', verifyPasswordStrength(), '” section'function verifyPasswordStrength(password: string): Promise<boolean>
Defined in: studiocms/packages/studiocms/src/lib/auth/password.ts:74
Verifies the strength of a given password.
The password must meet the following criteria:
- Be between 6 and 255 characters in length.
- Not be a known unsafe password.
- Not be found in the pwned password database.
Parameters
'Read the “', Parameters, '” section'string
The password to verify.
Promise
<boolean
>
A promise that resolves to true
if the password is strong/secure enough, otherwise false
.