diff --git a/selfprivacy_api/repositories/users/kanidm_user_repository.py b/selfprivacy_api/repositories/users/kanidm_user_repository.py index 08ae356..785d539 100644 --- a/selfprivacy_api/repositories/users/kanidm_user_repository.py +++ b/selfprivacy_api/repositories/users/kanidm_user_repository.py @@ -89,9 +89,8 @@ class KanidmAdminToken: stderr=subprocess.DEVNULL, ) - new_kanidm_admin_password = re.search(r'{"password":"([^"]+)"}', output).group( - 1 - ) # we have many not json strings in output + new_kanidm_admin_password = re.findall(r'{"password":"([^"]+)"}', output)[-1] + # we have many not json strings in output redis.set("kanidm:password", new_kanidm_admin_password) return new_kanidm_admin_password