aboutsummaryrefslogtreecommitdiff
path: root/src/lib/merchant_api_post_instance_auth.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-01 22:49:04 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-01 22:49:04 +0200
commit92b86cc5a7277de1a3b3ab55aaf37c83a649930e (patch)
treeeef73525a65c6fe6825559f050b8ea971ca8302a /src/lib/merchant_api_post_instance_auth.c
parent4e18bf19dfed52aa448a0b0d8547c0be182ba36a (diff)
downloadmerchant-92b86cc5a7277de1a3b3ab55aaf37c83a649930e.tar.gz
merchant-92b86cc5a7277de1a3b3ab55aaf37c83a649930e.tar.bz2
merchant-92b86cc5a7277de1a3b3ab55aaf37c83a649930e.zip
finish implementing #6935
Diffstat (limited to 'src/lib/merchant_api_post_instance_auth.c')
-rw-r--r--src/lib/merchant_api_post_instance_auth.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/lib/merchant_api_post_instance_auth.c b/src/lib/merchant_api_post_instance_auth.c
index a659ffb5..bda209ee 100644
--- a/src/lib/merchant_api_post_instance_auth.c
+++ b/src/lib/merchant_api_post_instance_auth.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2018, 2020 Taler Systems SA
+ Copyright (C) 2014-2021 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
@@ -168,24 +168,17 @@ TALER_MERCHANT_instance_auth_post (
}
if (NULL == auth_token)
{
- req_obj = json_pack ("{s:s}",
- "method",
- "external");
+ req_obj = GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_string ("method",
+ "external"));
}
else
{
- req_obj = json_pack ("{s:s, s:s}",
- "method",
- "token",
- "token",
- auth_token);
- }
- if (NULL == req_obj)
- {
- GNUNET_break (0);
- GNUNET_free (iaph->url);
- GNUNET_free (iaph);
- return NULL;
+ req_obj = GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_string ("method",
+ "token"),
+ GNUNET_JSON_pack_string ("token",
+ auth_token));
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Requesting URL '%s'\n",
@@ -194,6 +187,7 @@ TALER_MERCHANT_instance_auth_post (
CURL *eh;
eh = curl_easy_init ();
+ GNUNET_assert (NULL != eh);
if (GNUNET_OK !=
TALER_curl_easy_post (&iaph->post_ctx,
eh,