mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-02-16 18:31:49 +01:00
Fix Always On TOTP update when a HOTP exists - Closes #265
This commit is contained in:
parent
78a1eebdd2
commit
9fa4142a12
@ -253,14 +253,16 @@
|
||||
fetchPromise.then(response => {
|
||||
let generatedAt = 0
|
||||
|
||||
// twofaccounts OTP updates
|
||||
// twofaccounts TOTP updates
|
||||
response.data.forEach((account) => {
|
||||
const index = twofaccounts.items.findIndex(acc => acc.id === account.id)
|
||||
if (twofaccounts.items[index] == undefined) {
|
||||
twofaccounts.items.push(account)
|
||||
if (account.otp_type === 'totp') {
|
||||
const index = twofaccounts.items.findIndex(acc => acc.id === account.id)
|
||||
if (twofaccounts.items[index] == undefined) {
|
||||
twofaccounts.items.push(account)
|
||||
}
|
||||
else twofaccounts.items[index].otp = account.otp
|
||||
generatedAt = account.otp.generated_at
|
||||
}
|
||||
else twofaccounts.items[index].otp = account.otp
|
||||
generatedAt = account.otp.generated_at
|
||||
})
|
||||
|
||||
// Loopers restart at new timestamp
|
||||
|
Loading…
Reference in New Issue
Block a user