diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/FinTsJobExecutor.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/FinTsJobExecutor.kt index 9deeb625..2547819b 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/FinTsJobExecutor.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/FinTsJobExecutor.kt @@ -387,8 +387,10 @@ open class FinTsJobExecutor( while (tanChallenge.isEnteringTanDone == false) { delay(500) - // most TANs a valid 5 - 15 minutes. So terminate wait process after that time - if (Instant.nowExt() > tanChallenge.challengeCreationTimestamp.plusMinutes(15)) { + val now = Instant.nowExt() + if ((tanChallenge.tanExpirationTime != null && now > tanChallenge.tanExpirationTime) || + // most TANs a valid 5 - 15 minutes. So terminate wait process after that time + (tanChallenge.tanExpirationTime == null && now > tanChallenge.challengeCreationTimestamp.plusMinutes(15))) { if (tanChallenge.isEnteringTanDone == false) { tanChallenge.userDidNotEnterTan() }