diff options
Diffstat (limited to 'packages/anastasis-core/src')
-rw-r--r-- | packages/anastasis-core/src/index.ts | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/packages/anastasis-core/src/index.ts b/packages/anastasis-core/src/index.ts index 362ac3317..3be0d7b76 100644 --- 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", }, }, }; |