Generate codes 10s into the future for touch credentials

This commit is contained in:
Emil Lundberg 2017-11-21 17:25:55 +01:00
parent ad449fd1f8
commit 1f6cefea4f
No known key found for this signature in database
GPG Key ID: 5B9688125FF0B636

View File

@ -205,7 +205,8 @@ Python {
function calculate(entry, copyAfterUpdate) {
var now = Math.floor(Date.now() / 1000)
do_call('yubikey.controller.calculate', [entry.credential, now],
var margin = entry.credential.touch ? 10 : 0;
do_call('yubikey.controller.calculate', [entry.credential, now + margin],
function (code) {
updateSingleCredential(entry.credential, code, copyAfterUpdate)
})
@ -213,7 +214,8 @@ Python {
function calculateSlotMode(slot, digits, copyAfterUpdate) {
var now = Math.floor(Date.now() / 1000)
do_call('yubikey.controller.calculate_slot_mode', [slot, digits, now],
var margin = entry.credential.touch ? 10 : 0;
do_call('yubikey.controller.calculate_slot_mode', [slot, digits, now + margin],
function (entry) {
updateSingleCredential(entry.credential, entry.code, copyAfterUpdate)
})