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 # Verification that user has a valid TOTP app
if ( $action eq 'register' ) { if ( $action eq 'verify' ) {
# Get form token # Get form token
my $token = $req->param('token'); my $token = $req->param('token');

View File

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

View File

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

View File

@ -23,9 +23,9 @@
<span trspan="changeKey">Change key</span> <span trspan="changeKey">Change key</span>
</span> </span>
&nbsp;&nbsp; &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 class="glyphicon glyphicon-check"></span>&nbsp;
<span trspan="register">Register</span> <span trspan="verify">Verify</span>
</span> </span>
</div> </div>
</div> </div>