From 6b7026ef696c9560006c2775862b1ab7949cf522 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Thu, 3 Nov 2022 16:28:07 +0100 Subject: [PATCH] Here too --- core/admin/mailu/sso/views/base.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/admin/mailu/sso/views/base.py b/core/admin/mailu/sso/views/base.py index 34ba98b5..6fa9403f 100644 --- a/core/admin/mailu/sso/views/base.py +++ b/core/admin/mailu/sso/views/base.py @@ -41,9 +41,8 @@ def login(): response = flask.redirect(destination) response.set_cookie('rate_limit', utils.limiter.device_cookie(username), max_age=31536000, path=flask.url_for('sso.login'), secure=app.config['SESSION_COOKIE_SECURE'], httponly=True) flask.current_app.logger.info(f'Login succeeded for {username} from {client_ip} pwned={form.pwned.data}.') - breaches = int(form.pwned.data) - if breaches > 0: - flask.flash(f"Your password appears in {breaches} data breaches! Please change it.", "error") + if msg := utils.isBadOrPwned(form): + flask.flash(msg, "error") return response else: utils.limiter.rate_limit_user(username, client_ip, device_cookie, device_cookie_username) if models.User.get(username) else utils.limiter.rate_limit_ip(client_ip)