This commit is contained in:
Christophe Maudoux 2018-04-11 23:31:57 +02:00
parent b5e61fab2e
commit 0987f65804
4 changed files with 8 additions and 7 deletions

View File

@ -41,7 +41,7 @@ sub run {
}
# Verification that user has a valid TOTP app
if ( $action eq 'register' ) {
if ( $action eq 'verify' ) {
# Get form token
my $token = $req->param('token');

View File

@ -55,14 +55,14 @@ getKey = (reset) ->
setMsg 'yourTotpKey', 'success'
token = data.token
register = ->
verify = ->
val = $('#code').val()
unless val
setMsg 'fillTheForm', 'warning'
else
$.ajax
type: "POST",
url: "#{portal}/2fregisters/totp/register"
url: "#{portal}/2fregisters/totp/verify"
dataType: 'json'
data:
token: token
@ -82,5 +82,5 @@ $(document).ready ->
getKey(0)
$('#changekey').on 'click', () ->
getKey(1)
$('#register').on 'click', () ->
register()
$('#verify').on 'click', () ->
verify()

View File

@ -159,6 +159,7 @@
"noHistory":"هذا هو أول اتصال، مرحبا بك!",
"notAuthorized":"You're not authorized too do this",
"notFound": "لم يتم العثور: محاولة الدخول إلى صفحة غير متوفرة",
"noTOTPFound":"No TOTP found",
"noU2FKeyFound": "No U2F key found",
"oidcConsent":"التطبيق ٪s هل ترغب في معرفة:",
"oidcConsents": "OIDC consents",

View File

@ -23,9 +23,9 @@
<span trspan="changeKey">Change key</span>
</span>
&nbsp;&nbsp;
<span id="register" class="btn btn-success" role="button">
<span id="verify" class="btn btn-success" role="button">
<span class="glyphicon glyphicon-check"></span>&nbsp;
<span trspan="register">Register</span>
<span trspan="verify">Verify</span>
</span>
</div>
</div>