From cc52be1a1bf3507edcfbe91991fb460fb59b9227 Mon Sep 17 00:00:00 2001 From: ornanovitch <ornano@felinn.org> Date: Mon, 25 Oct 2021 22:37:28 +0200 Subject: [PATCH] aller jusqu'au bout de la logique... --- hiboo/account/settings.py | 12 ++++++------ hiboo/templates/macros.html | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/hiboo/account/settings.py b/hiboo/account/settings.py index fdbff79..843dd6e 100644 --- a/hiboo/account/settings.py +++ b/hiboo/account/settings.py @@ -52,31 +52,31 @@ def totp(): @blueprint.route("/totp/setup", methods=["GET", "POST"]) @security.authentication_required() -@security.confirmation_required("Setup 2FA with TOTP") +@security.confirmation_required("setup 2FA with TOTP") def totp_setup(): user = flask_login.current_user auth = models.Auth(models.Auth.TOTP) auth.set_otp_key() user.auths[models.Auth.TOTP] = auth - models.log(models.History.MFA, comment=str(_("2FA has been enabled")), + models.log(models.History.MFA, comment=str(_("2FA with TOTP has been enabled")), user=flask_login.current_user) models.db.session.add(auth) models.db.session.commit() - flask.flash(_("Successfully setup 2FA"), "success") + flask.flash(_("Successfully setup 2FA with TOTP"), "success") return flask.redirect(flask.url_for(".totp")) @blueprint.route("/totp/delete", methods=["GET", "POST"]) @security.authentication_required() -@security.confirmation_required("Delete 2FA with TOTP") +@security.confirmation_required("delete 2FA with TOTP") def totp_delete(): user = flask_login.current_user auth = user.auths[models.Auth.TOTP] - models.log(models.History.MFA, comment=str(_("2FA has been disabled")), + models.log(models.History.MFA, comment=str(_("2FA with TOTP has been disabled")), user=flask_login.current_user) models.db.session.delete(auth) models.db.session.commit() - flask.flash(_("Successfully disabled 2FA"), "success") + flask.flash(_("Successfully disabled 2FA with TOTP"), "success") return flask.redirect(flask.url_for(".totp")) diff --git a/hiboo/templates/macros.html b/hiboo/templates/macros.html index b9b8af0..117e6b2 100644 --- a/hiboo/templates/macros.html +++ b/hiboo/templates/macros.html @@ -17,7 +17,6 @@ "create": "plus", "transition": "recycle", "password": "lock", - "enable 2fa": "qrcode", "mfa": "qrcode" }[event.category] }} bg-blue"></i> <div class="timeline-item"> -- GitLab