lib/auth/password
Esta página aún no está disponible en tu idioma.
Functions
Section titled “Functions”hashPassword()
Section titled “hashPassword()”function hashPassword(password: string, _salt?: string): Promise<string>
Defined in: studiocms/packages/studiocms/src/lib/auth/password.ts:57
Hashes a plain text password using script.
Parameters
Section titled “Parameters”password
Section titled “password”string
The plain text password to hash.
_salt?
Section titled “_salt?”string
Returns
Section titled “Returns”Promise
<string
>
A promise that resolves to the hashed password.
verifyPasswordHash()
Section titled “verifyPasswordHash()”function verifyPasswordHash(hash: string, password: string): Promise<boolean>
Defined in: studiocms/packages/studiocms/src/lib/auth/password.ts:70
Verifies if the provided password matches the hashed password.
Parameters
Section titled “Parameters”string
The hashed password to compare against.
password
Section titled “password”string
The plain text password to verify.
Returns
Section titled “Returns”Promise
<boolean
>
A promise that resolves to a boolean indicating whether the password matches the hash.
verifyPasswordStrength()
Section titled “verifyPasswordStrength()”function verifyPasswordStrength(password: string): Promise<string | true>
Defined in: studiocms/packages/studiocms/src/lib/auth/password.ts:89
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
Section titled “Parameters”password
Section titled “password”string
The password to verify.
Returns
Section titled “Returns”Promise
<string
| true
>
A promise that resolves to true
if the password is strong/secure enough, otherwise false
.