diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2023-09-06 22:58:57 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2023-09-06 22:58:57 +0200 |
commit | c68a0b309f570454423efb9eb6404208e0cae3d9 (patch) | |
tree | 52388e31f5aefd43b7c7360524d9ee874f6d8cf9 /src/backend/taler-merchant-httpd_private-post-instances-ID-token.c | |
parent | 78a0c837355f97df7331212e4faf71eed81c05ca (diff) | |
download | merchant-c68a0b309f570454423efb9eb6404208e0cae3d9.tar.gz merchant-c68a0b309f570454423efb9eb6404208e0cae3d9.tar.bz2 merchant-c68a0b309f570454423efb9eb6404208e0cae3d9.zip |
keep using Bearer prefix
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-post-instances-ID-token.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-post-instances-ID-token.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-instances-ID-token.c b/src/backend/taler-merchant-httpd_private-post-instances-ID-token.c index 839c68d1..a223a882 100644 --- a/src/backend/taler-merchant-httpd_private-post-instances-ID-token.c +++ b/src/backend/taler-merchant-httpd_private-post-instances-ID-token.c @@ -117,17 +117,32 @@ TMH_private_post_instances_ID_token (const struct TMH_RequestHandler *rh, case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: break; } - return TALER_MHD_REPLY_JSON_PACK ( - connection, - MHD_HTTP_OK, - GNUNET_JSON_pack_data_auto ("token", - &btoken), - GNUNET_JSON_pack_string ("scope", - scope), - GNUNET_JSON_pack_bool ("refreshable", - refreshable), - GNUNET_JSON_pack_timestamp ("expiration", - expiration_time)); + + { + char *tok; + MHD_RESULT ret; + char *val; + + val = GNUNET_STRINGS_data_to_string_alloc (&btoken, + sizeof (btoken)); + GNUNET_asprintf (&tok, + RFC_8959_PREFIX "%s", + val); + GNUNET_free (val); + ret = TALER_MHD_REPLY_JSON_PACK ( + connection, + MHD_HTTP_OK, + GNUNET_JSON_pack_string ("token", + tok), + GNUNET_JSON_pack_string ("scope", + scope), + GNUNET_JSON_pack_bool ("refreshable", + refreshable), + GNUNET_JSON_pack_timestamp ("expiration", + expiration_time)); + GNUNET_free (tok); + return ret; + } } |