Validate password in backend-core

This commit is contained in:
Adria Navarro 2024-01-02 12:29:27 +01:00
parent 6909cbed29
commit c15a917e00
4 changed files with 14 additions and 1 deletions

@ -1 +1 @@
Subproject commit e46a352a6326a838faa00f912de069aee95d7300
Subproject commit c764a88325b7ecd55aeff2140eab08fe9b32dac7

View File

@ -38,6 +38,7 @@ export * as docIds from "./docIds"
// circular dependencies
import * as context from "./context"
import * as _tenancy from "./tenancy"
export * as security from "./security"
export const tenancy = {
..._tenancy,

View File

@ -0,0 +1,11 @@
const MIN_LENGTH = 8
export function validatePassword(
password: string
): { valid: true } | { valid: false; error: string } {
if (password?.length < MIN_LENGTH) {
return { valid: false, error: "Password invalid. Minimum eight characters" }
}
return { valid: true }
}

View File

@ -0,0 +1 @@
export * from "./auth"