mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-03 02:39:11 -05:00
feat: Add new ENV VAR for custom error message on error on signup / password change due to password not meeting requirements (#20650)
* add env var for custom auth pw message * Update auth.py * Update auth.py
This commit is contained in:
@@ -33,6 +33,7 @@ from open_webui.env import (
|
||||
ENABLE_PASSWORD_VALIDATION,
|
||||
OFFLINE_MODE,
|
||||
LICENSE_BLOB,
|
||||
PASSWORD_VALIDATION_HINT,
|
||||
PASSWORD_VALIDATION_REGEX_PATTERN,
|
||||
REDIS_KEY_PREFIX,
|
||||
pk,
|
||||
@@ -173,7 +174,7 @@ def validate_password(password: str) -> bool:
|
||||
|
||||
if ENABLE_PASSWORD_VALIDATION:
|
||||
if not PASSWORD_VALIDATION_REGEX_PATTERN.match(password):
|
||||
raise Exception(ERROR_MESSAGES.INVALID_PASSWORD())
|
||||
raise Exception(ERROR_MESSAGES.INVALID_PASSWORD(PASSWORD_VALIDATION_HINT))
|
||||
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user