diff --git a/yoda_eus/password_complexity.py b/yoda_eus/password_complexity.py
index db15905..2ab51b6 100644
--- a/yoda_eus/password_complexity.py
+++ b/yoda_eus/password_complexity.py
@@ -33,4 +33,7 @@ def check_password_complexity(password: str) -> List[str]:
if not (any(c in string.punctuation for c in password)):
errors.append("Password needs to contain at least one punctuation character ({})".format(string.punctuation))
+ if "\\" in password:
+ errors.append("Password must not contain backslashes.")
+
return errors
diff --git a/yoda_eus/templates/web/password-requirements.html b/yoda_eus/templates/web/password-requirements.html
index aee37c9..96fdfb6 100644
--- a/yoda_eus/templates/web/password-requirements.html
+++ b/yoda_eus/templates/web/password-requirements.html
@@ -1,7 +1,7 @@
Your password must meet the following requirements:
- It must be between 10 and 1000 characters in length
-
- It must not contain diacritics such as é, ö, and ç
+
- It must not contain diacritics such as é, ö, and ç, or backslashes (\)
- At least 1 capital letter A-Z
- At least 1 lowercase letter a-z
- At least 1 number 0-9
diff --git a/yoda_eus/tests/test_unit.py b/yoda_eus/tests/test_unit.py
index d8c85b9..a01a310 100644
--- a/yoda_eus/tests/test_unit.py
+++ b/yoda_eus/tests/test_unit.py
@@ -41,6 +41,10 @@ def test_password_validation_no_punctuation(self):
result = check_password_complexity("Test123456789")
assert result == ["Password needs to contain at least one punctuation character ({})".format(string.punctuation)]
+ def test_password_validation_backslash(self):
+ result = check_password_complexity("Test\\123456789!")
+ assert result == ["Password must not contain backslashes."]
+
def test_password_validation_multiple(self):
result = check_password_complexity("Test")
assert len(result) == 3