From 37c29a073e10e4b250a5a0a03ce79599a4a71d7e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 4 Sep 2021 15:21:48 +0200 Subject: [PATCH] policies/password: fix symbols not being checked correctly Signed-off-by: Jens Langhammer --- authentik/policies/password/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/authentik/policies/password/models.py b/authentik/policies/password/models.py index 742054ef5..788c84667 100644 --- a/authentik/policies/password/models.py +++ b/authentik/policies/password/models.py @@ -70,9 +70,8 @@ class PasswordPolicy(Policy): return PolicyResult(False, self.error_message) if self.amount_symbols > 0: count = 0 - for symbol in self.symbol_charset.split(): - if symbol in password: - count += 1 + for symbol in self.symbol_charset: + count += password.count(symbol) if count < self.amount_symbols: LOGGER.debug("password failed", reason="amount_symbols") return PolicyResult(False, self.error_message)