mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-19 19:28:08 +02: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 => {
|
fetchPromise.then(response => {
|
||||||
let generatedAt = 0
|
let generatedAt = 0
|
||||||
|
|
||||||
// twofaccounts OTP updates
|
// twofaccounts TOTP updates
|
||||||
response.data.forEach((account) => {
|
response.data.forEach((account) => {
|
||||||
const index = twofaccounts.items.findIndex(acc => acc.id === account.id)
|
if (account.otp_type === 'totp') {
|
||||||
if (twofaccounts.items[index] == undefined) {
|
const index = twofaccounts.items.findIndex(acc => acc.id === account.id)
|
||||||
twofaccounts.items.push(account)
|
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
|
// Loopers restart at new timestamp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user