switch from custom scheme to basic auth for Taler demo bank

This commit is contained in:
Florian Dold 2020-01-17 21:03:13 +01:00
parent 0842fab154
commit 2d97d0c37f
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -51,14 +51,16 @@ export class Bank {
const reqUrl = new URL("api/withdraw-headless-uri", this.bankBaseUrl).href; 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({ const resp = await Axios({
method: "post", method: "post",
url: reqUrl, url: reqUrl,
data: body, data: body,
responseType: "json", responseType: "json",
headers: { headers: {
"X-Taler-Bank-Username": bankUser.username, "Authorization": `Basic ${authEncoded}`,
"X-Taler-Bank-Password": bankUser.password,
}, },
}); });