UNPKG

studiocms

Version:

Astro Native CMS for AstroDB. Built from the ground up by the Astro community.

23 lines (22 loc) 1.52 kB
import { Effect } from '../../effect.js'; /** * Asynchronously initializes and retrieves the `hashPassword` function using the provided * password module options and Scrypt configuration. The configuration is supplied via * the `CMS_ENCRYPTION_KEY` environment variable. This utility is typically used for * securely hashing user passwords within the CMS. * * @remarks * - Uses an effect system to manage dependencies and asynchronous operations. * - The Scrypt algorithm is used for password hashing. * - The function is provided with live password module options. * * @returns An object containing the `hashPassword` function. * * @throws If the password module options or Scrypt configuration fail to initialize. */ declare const hashPassword: (password: string, _salt?: string | undefined) => Effect.Effect<string, import("@withstudiocms/effect/scrypt").ScryptError, never>, verifyPasswordStrength: (pass: string) => Effect.Effect<string | true, import("@withstudiocms/auth-kit/errors").PasswordError | import("@withstudiocms/auth-kit/errors").CheckIfUnsafeError | import("@effect/platform/HttpClientError").ResponseError, never>; declare const getCheckers: Effect.Effect<{ username: (val: string) => Effect.Effect<boolean, import("@withstudiocms/auth-kit/errors").CheckIfUnsafeError, never>; password: (val: string) => Effect.Effect<boolean, import("@withstudiocms/auth-kit/errors").CheckIfUnsafeError, never>; }, never, never>; export { hashPassword, verifyPasswordStrength, getCheckers };