aboutsummaryrefslogtreecommitdiff
path: root/src/headless
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-01-17 21:03:13 +0100
committerFlorian Dold <florian.dold@gmail.com>2020-01-17 21:03:13 +0100
commit2d97d0c37f338b8f9fb5459da6a83b77c9d6ae98 (patch)
tree616a4726d916d6cb40dd1a2eef0f2e71e5ab7cba /src/headless
parent0842fab15482f155b967b4b100b0575bf44ce667 (diff)
switch from custom scheme to basic auth for Taler demo bank
Diffstat (limited to 'src/headless')
-rw-r--r--src/headless/bank.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/headless/bank.ts b/src/headless/bank.ts
index 99d7e050b..4a5379280 100644
--- a/src/headless/bank.ts
+++ b/src/headless/bank.ts
@@ -51,14 +51,16 @@ export class Bank {
const reqUrl = new URL("api/withdraw-headless-uri", this.bankBaseUrl).href;
+ const auth = `${bankUser.username}:${bankUser.password}`;
+ const authEncoded: string = Buffer.from(auth).toString("base64")
+
const resp = await Axios({
method: "post",
url: reqUrl,
data: body,
responseType: "json",
headers: {
- "X-Taler-Bank-Username": bankUser.username,
- "X-Taler-Bank-Password": bankUser.password,
+ "Authorization": `Basic ${authEncoded}`,
},
});