summaryrefslogtreecommitdiff
path: root/packages/taler-util/src/http-client/bank-core.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-util/src/http-client/bank-core.ts')
-rw-r--r--packages/taler-util/src/http-client/bank-core.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/taler-util/src/http-client/bank-core.ts b/packages/taler-util/src/http-client/bank-core.ts
index b544d56fe..7a98b6281 100644
--- a/packages/taler-util/src/http-client/bank-core.ts
+++ b/packages/taler-util/src/http-client/bank-core.ts
@@ -140,16 +140,18 @@ export class TalerCoreBankHttpClient {
*
*/
async createAccount(
- auth: AccessToken,
+ auth: AccessToken | undefined,
body: TalerCorebankApi.RegisterAccountRequest,
) {
const url = new URL(`accounts`, this.baseUrl);
+ const headers: Record<string, string> = {}
+ if (auth) {
+ headers.Authorization = makeBearerTokenAuthHeader(auth)
+ }
const resp = await this.httpLib.fetch(url.href, {
method: "POST",
body,
- headers: {
- Authorization: makeBearerTokenAuthHeader(auth),
- },
+ headers: headers,
});
switch (resp.status) {
case HttpStatusCode.Ok: {