commit b42c2443758d98954add139835ab2a8c8934b6af
parent fead394c8b8fe65cb02ad0f8fc6d867c8391148e
Author: Sebastian <sebasjm@gmail.com>
Date: Mon, 24 Nov 2025 11:05:16 -0300
fix #10647
Diffstat:
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/packages/bank-ui/src/pages/SolveMFA.tsx b/packages/bank-ui/src/pages/SolveMFA.tsx
@@ -237,11 +237,8 @@ export function SolveMFAChallenges({
// FIXME: we should save here also the expiration of the
// tan channel to be used when the user press "i have the code"
const [retransmission, setRetransmission] = useState<
- Record<TanChannel, AbsoluteTime>
- >({
- email: AbsoluteTime.now(),
- sms: AbsoluteTime.now(),
- });
+ Record<string, AbsoluteTime | undefined>
+ >({});
if (selected) {
return (
@@ -252,7 +249,16 @@ export function SolveMFAChallenges({
username={username}
onSolved={() => {
setSelected(undefined);
- setSolved([...solved, selected.ch.challenge_id]);
+ const total = [...solved, selected.ch.challenge_id];
+ const enough = currentChallenge.combi_and
+ ? total.length === currentChallenge.challenges.length
+ : total.length > 0;
+
+ if (enough) {
+ onCompleted.withArgs(total).call();
+ } else {
+ setSolved(total);
+ }
}}
/>
);
@@ -272,7 +278,7 @@ export function SolveMFAChallenges({
if (success.earliest_retransmission) {
setRetransmission({
...retransmission,
- [ch.tan_channel]: AbsoluteTime.fromProtocolTimestamp(
+ [ch.challenge_id]: AbsoluteTime.fromProtocolTimestamp(
success.earliest_retransmission,
),
});
@@ -368,7 +374,7 @@ export function SolveMFAChallenges({
</span>
</h2>
{currentChallenge.challenges.map((challenge) => {
- const time = retransmission[challenge.tan_channel];
+ const time = retransmission[challenge.challenge_id] ?? AbsoluteTime.now();
const alreadySent = !AbsoluteTime.isExpired(time);
const noNeedToComplete =
hasSolvedEnough ||