From 0da56030002733484d0b4c2a58d6f317c808c170 Mon Sep 17 00:00:00 2001 From: ornanovitch <ornano@felinn.org> Date: Mon, 25 Oct 2021 22:44:13 +0200 Subject: [PATCH] =?UTF-8?q?TOTP=20est=20une=20m=C3=A9thode=20de=202FA/MFA?= =?UTF-8?q?=20parmi=20d'autres,=20mieux=20vaut=20appeler=20tout=20ce=20qui?= =?UTF-8?q?=20concerne=20TOTP=20"TOTP",=20et=20garder=20"MFA"=20pour=20les?= =?UTF-8?q?=20r=C3=A9f=C3=A9rences=20g=C3=A9n=C3=A9riques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hiboo/account/settings.py | 12 ++++++------ hiboo/account/templates/account_totp.html | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hiboo/account/settings.py b/hiboo/account/settings.py index 843dd6e..4b61027 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 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 with TOTP has been enabled")), + models.log(models.History.MFA, comment=str(_("TOTP has been enabled")), user=flask_login.current_user) models.db.session.add(auth) models.db.session.commit() - flask.flash(_("Successfully setup 2FA with TOTP"), "success") + flask.flash(_("Successfully setup 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("disable TOTP") def totp_delete(): user = flask_login.current_user auth = user.auths[models.Auth.TOTP] - models.log(models.History.MFA, comment=str(_("2FA with TOTP has been disabled")), + models.log(models.History.MFA, comment=str(_("TOTP has been disabled")), user=flask_login.current_user) models.db.session.delete(auth) models.db.session.commit() - flask.flash(_("Successfully disabled 2FA with TOTP"), "success") + flask.flash(_("Successfully disabled TOTP"), "success") return flask.redirect(flask.url_for(".totp")) diff --git a/hiboo/account/templates/account_totp.html b/hiboo/account/templates/account_totp.html index b63ac5c..1988074 100644 --- a/hiboo/account/templates/account_totp.html +++ b/hiboo/account/templates/account_totp.html @@ -11,7 +11,7 @@ <h5>{% trans %}Not configured{% endtrans %}</h5> <p>{% trans %}Two-factor authentication with Time-based One-Time Passowrd is not setup.{% endtrans %} <br> - {% trans %}Click on "Setup 2FA" to get started.{% endtrans %} + {% trans %}Click on "Setup TOTP" to get started.{% endtrans %} </p> </blockquote> </div> @@ -47,9 +47,9 @@ {% block actions %} {% if not key %} -<a href="{{ url_for(".totp_setup") }}" class="btn btn-info">{% trans %}Setup 2FA{% endtrans %}</a> +<a href="{{ url_for(".totp_setup") }}" class="btn btn-info">{% trans %}Setup TOTP{% endtrans %}</a> {% else %} -<a href="{{ url_for(".totp_delete") }}" class="btn btn-warning">{% trans %}Delete 2FA{% endtrans %}</a> +<a href="{{ url_for(".totp_delete") }}" class="btn btn-warning">{% trans %}Delete TOTP{% endtrans %}</a> {% endif %} {% endblock %} -- GitLab