aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-11-05 12:50:18 +0100
committerFlorian Dold <florian@dold.me>2021-11-05 12:50:18 +0100
commite627f65f3cf61428202e47e9e68a5baf4a9abfae (patch)
treea893f9cd2a1ac6aaa2cae8e1d4bb1560eda7cc30
parentdc1fce22778273df6946d3b3efd0eb90b285a8dd (diff)
anastasis-core: towards supporting iban auth
-rw-r--r--packages/anastasis-core/src/index.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/anastasis-core/src/index.ts b/packages/anastasis-core/src/index.ts
index 2fdf0f833..d3e938f0f 100644
--- a/packages/anastasis-core/src/index.ts
+++ b/packages/anastasis-core/src/index.ts
@@ -930,6 +930,20 @@ async function requestTruth(
};
}
+ if (resp.status === HttpStatusCode.Accepted) {
+ const body = await resp.json();
+ logger.info(`got body ${j2s(body)}`);
+ if (body.method === "iban") {
+ // FIXME:
+ } else {
+ return {
+ code: TalerErrorCode.ANASTASIS_TRUTH_CHALLENGE_FAILED,
+ hint: "unknown external authentication method",
+ http_status: resp.status,
+ } as ReducerStateError;
+ }
+ }
+
return {
code: TalerErrorCode.ANASTASIS_TRUTH_CHALLENGE_FAILED,
hint: "got unexpected /truth/ response status",