This commit is contained in:
Aitzol 2023-11-24 20:06:38 +01:00
parent e2d0e7a95e
commit 92bc2bbdbf
4 changed files with 66 additions and 8 deletions

View File

@ -13,32 +13,41 @@
<body> <body>
<main> <main>
<h1>2FA</h1> <h1>{{ str['2fa-title'] }}</h1>
% if data['secureAuth'] == True: % if data['secureAuth'] == True:
<div class="info">
Aurrerantzean ondorengo kodea erabili beharko duzu saioa hasteko. Mugikorrerako OTP edo 2FA aplikazioa baten
bidez QR kodea irakurtzean jasoko duzun gakoa baliatuz horretarako.
</div>
<div class="qr-code"> <div class="qr-code">
<img src="{{'static/tmp/'+data['authToken']+'.png'}}" /> <img src="{{'static/tmp/'+data['authToken']+'.png'}}" />
</div> </div>
<form name="disable2faForm" method="post" action="/disable_2fa"> <form name="disable2faForm" method="post" action="/disable_2fa">
<input id="2fa" name="2fa" type="text" value="{{data['authToken']}}" readonly> <label for="token">{{ str['token'] }}</label>
<input id="token" name="token" type="text" value="{{data['authToken']}}" readonly>
<div class="form-buttons"> <div class="form-buttons">
<a href="/user"><button class="green" type="button">{{ str['back'] }}</button></a> <a href="/user"><button class="green" type="button">{{ str['back'] }}</button></a>
<button class="green" type="submit">Disable</button> <button class="green" type="submit">{{ str['disable'] }}</button>
</div> </div>
</form> </form>
% else: % else:
<div class="info">
Bi urratseko autentifikazioa segurtasun gehigarri bat da. Hau gaituz saio hasieran erabiltzaile eta pasahitzaz
gain QR bidez jasoko duzun gako bat eskatuko zaizu.
</div>
<form name="enable2faForm" method="post" action="/enable_2fa"> <form name="enable2faForm" method="post" action="/enable_2fa">
<input id="2fa" name="2fa" type="text" value="{{data['authToken']}}" readonly> <!--<input id="token" name="token" type="text" value="{{data['authToken']}}" readonly>-->
<div class="form-buttons"> <div class="form-buttons">
<a href="/user"><button class="green" type="button">{{ str['back'] }}</button></a> <a href="/user"><button class="green" type="button">{{ str['back'] }}</button></a>
<button class="green" type="submit">Enable</button> <button class="green" type="submit">{{ str['enable'] }}</button>
</div> </div>
</form> </form>

View File

@ -40,6 +40,12 @@ class LocalizeTo(object):
str_25 = _("Last login") str_25 = _("Last login")
str_26 = _("Devices") str_26 = _("Devices")
str_27 = _("show") str_27 = _("show")
str_28 = _("Two factor authentication")
str_29 = _("Token")
str_30 = _("Disable")
str_31 = _("Enable")
str_32 = _("You must then use the following code to log in. Using the key you will receive by reading the QR code via a OTP or 2FA mobile app.")
str_33 = _("Two factor authentication is additional security. By enabling this you will be asked at the login, in addition to the user and password, a key you will receive by QR.")
#messages #messages
msg_00 = _("The session was closed.") msg_00 = _("The session was closed.")
@ -77,5 +83,6 @@ class LocalizeTo(object):
'del':str_12, 'sign-up':str_13, 'back':str_14, 'update':str_15, 'or-sign-in':str_16, 'del':str_12, 'sign-up':str_13, 'back':str_14, 'update':str_15, 'or-sign-in':str_16,
'or-sign-up':str_17, 'inv-code':str_18, 'edit-fn':str_19, 'edit-email':str_20, 'ch-pwd':str_21, 'or-sign-up':str_17, 'inv-code':str_18, 'edit-fn':str_19, 'edit-email':str_20, 'ch-pwd':str_21,
'del-account':str_22, 'welcome':str_23, 'logs':str_24, 'last-login':str_25, 'devices':str_26, 'del-account':str_22, 'welcome':str_23, 'logs':str_24, 'last-login':str_25, 'devices':str_26,
'show':str_27, 'pwd-pattern': msg_08} 'show':str_27, '2fa-title':str_28, 'token':str_29, 'disable':str_30, 'enable':str_31, '2fa-info-1':str_32,
'2fa-info-2':str_33, 'pwd-pattern': msg_08}
self.msg = (msg_00, msg_01, msg_02, msg_03, msg_04, msg_05, msg_06, msg_07, msg_08, msg_09, msg_10, msg_11, msg_12, msg_13, msg_14, msg_15, msg_16, msg_17, msg_18, msg_19, msg_20, msg_21, msg_22, msg_23, msg_24, msg_25, msg_26, msg_27, msg_28) self.msg = (msg_00, msg_01, msg_02, msg_03, msg_04, msg_05, msg_06, msg_07, msg_08, msg_09, msg_10, msg_11, msg_12, msg_13, msg_14, msg_15, msg_16, msg_17, msg_18, msg_19, msg_20, msg_21, msg_22, msg_23, msg_24, msg_25, msg_26, msg_27, msg_28)

View File

@ -129,7 +129,31 @@ msgstr "Devices"
msgid "show" msgid "show"
msgstr "show" msgstr "show"
#: libs/localization.py:43
msgid "Two factor authentication"
msgstr "Two factor authentication"
#: libs/localization.py:44
msgid "Token"
msgstr "Token"
#: libs/localization.py:45 #: libs/localization.py:45
msgid "Disable"
msgstr "Disable"
#: libs/localization.py:46
msgid "Enable"
msgstr "Enable"
#: libs/localization.py:47
msgid "You must then use the following code to log in. Using the key you will receive by reading the QR code via a OTP or 2FA mobile app."
msgstr "You must then use the following code to log in. Using the key you will receive by reading the QR code via a OTP or 2FA mobile app."
#: libs/localization.py:48
msgid "Two factor authentication is additional security. By enabling this you will be asked at the login, in addition to the user and password, a key you will receive by QR."
msgstr "Two factor authentication is additional security. By enabling this you will be asked at the login, in addition to the user and password, a key you will receive by QR."
#: libs/localization.py:45 ZUZENTZEA FALTA
msgid "The session was closed." msgid "The session was closed."
msgstr "The session was closed." msgstr "The session was closed."

View File

@ -201,6 +201,15 @@ button.red:hover{
text-align: center; text-align: center;
} }
/**/
.info {
margin: 0 auto;
max-width: 24rem;
padding: 0 2.5rem 0 2.5rem;
text-align: justify;
}
/**/ /**/
.grid-container { .grid-container {
display: grid; display: grid;
@ -234,6 +243,15 @@ button.red:hover{
border: 0; border: 0;
} }
.info {
max-width: 16rem;
}
}
@media only screen and (min-width: 481px) and (max-width: 760px) {
.info {
max-width: 22rem;
}
} }
/* /*