Remove limits from password in dev
This commit is contained in:
parent
780a0ee687
commit
b0a12e034d
|
@ -1,9 +1,16 @@
|
||||||
|
import { env } from ".."
|
||||||
|
|
||||||
export const PASSWORD_MIN_LENGTH = 8
|
export const PASSWORD_MIN_LENGTH = 8
|
||||||
export const PASSWORD_MAX_LENGTH = 512
|
export const PASSWORD_MAX_LENGTH = 512
|
||||||
|
|
||||||
export function validatePassword(
|
export function validatePassword(
|
||||||
password: string
|
password: string
|
||||||
): { valid: true } | { valid: false; error: string } {
|
): { valid: true } | { valid: false; error: string } {
|
||||||
|
if (env.isDev() && !env.isTest() && password) {
|
||||||
|
// We accept any password while on development
|
||||||
|
return { valid: true }
|
||||||
|
}
|
||||||
|
|
||||||
if (!password || password.length < PASSWORD_MIN_LENGTH) {
|
if (!password || password.length < PASSWORD_MIN_LENGTH) {
|
||||||
return {
|
return {
|
||||||
valid: false,
|
valid: false,
|
||||||
|
|
Loading…
Reference in New Issue