taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit d43ab6af87f2729b37548336d42ffce0ed3c879e
parent 842cc327541ebcfc761208f42bf5f74e22c6283c
Author: Florian Dold <florian@dold.me>
Date:   Fri,  5 Nov 2021 18:55:52 +0100

anastasis-core: challenge feedback

Diffstat:
Mpackages/anastasis-core/src/index.ts | 17++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/packages/anastasis-core/src/index.ts b/packages/anastasis-core/src/index.ts @@ -952,6 +952,21 @@ async function requestTruth( } if (resp.status === HttpStatusCode.Forbidden) { + const body = await resp.json(); + if ( + body.code === TalerErrorCode.ANASTASIS_TRUTH_CHALLENGE_RESPONSE_REQUIRED + ) { + return { + ...state, + recovery_state: RecoveryStates.ChallengeSolving, + challenge_feedback: { + ...state.challenge_feedback, + [truth.uuid]: { + state: ChallengeFeedbackStatus.Pending, + }, + }, + }; + } return { ...state, recovery_state: RecoveryStates.ChallengeSolving, @@ -959,7 +974,7 @@ async function requestTruth( ...state.challenge_feedback, [truth.uuid]: { state: ChallengeFeedbackStatus.Message, - message: "Challenge should be solved", + message: body.hint ?? "Challenge should be solved", }, }, };