Validate password in backend-core
This commit is contained in:
parent
6909cbed29
commit
c15a917e00
|
@ -1 +1 @@
|
|||
Subproject commit e46a352a6326a838faa00f912de069aee95d7300
|
||||
Subproject commit c764a88325b7ecd55aeff2140eab08fe9b32dac7
|
|
@ -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,
|
||||
|
|
|
@ -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 }
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export * from "./auth"
|
Loading…
Reference in New Issue