summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-05-04 11:53:17 +0200
committerGravatar default2023-05-04 11:53:17 +0200
commit212d1350fe261dbc04eb8cc9a9462c5ce5747597 (patch)
tree7dc159b343364b544e248766f32013e6e23b886a
parentNew url /oauth/x-snac-get-token. (diff)
downloadpenes-snac2-212d1350fe261dbc04eb8cc9a9462c5ce5747597.tar.gz
penes-snac2-212d1350fe261dbc04eb8cc9a9462c5ce5747597.tar.xz
penes-snac2-212d1350fe261dbc04eb8cc9a9462c5ce5747597.zip
Fixed mastoapi debug levels.
-rw-r--r--mastoapi.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 6729cf7..3c4be5a 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -213,13 +213,13 @@ int oauth_get_handler(const xs_dict *req, const char *q_path,
213 *ctype = "text/html"; 213 *ctype = "text/html";
214 status = 200; 214 status = 200;
215 215
216 srv_debug(0, xs_fmt("oauth authorize: generating login page")); 216 srv_debug(1, xs_fmt("oauth authorize: generating login page"));
217 } 217 }
218 else 218 else
219 srv_debug(0, xs_fmt("oauth authorize: bad client_id %s", cid)); 219 srv_debug(1, xs_fmt("oauth authorize: bad client_id %s", cid));
220 } 220 }
221 else 221 else
222 srv_debug(0, xs_fmt("oauth authorize: invalid or unset arguments")); 222 srv_debug(1, xs_fmt("oauth authorize: invalid or unset arguments"));
223 } 223 }
224 else 224 else
225 if (strcmp(cmd, "/x-snac-get-token") == 0) { 225 if (strcmp(cmd, "/x-snac-get-token") == 0) {
@@ -389,7 +389,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
389 389
390 const char *uid = xs_dict_get(app, "uid"); 390 const char *uid = xs_dict_get(app, "uid");
391 391
392 srv_debug(0, xs_fmt("oauth token: " 392 srv_debug(1, xs_fmt("oauth token: "
393 "successful login for %s, new token %s", uid, tokid)); 393 "successful login for %s, new token %s", uid, tokid));
394 394
395 xs *token = xs_dict_new(); 395 xs *token = xs_dict_new();
@@ -403,7 +403,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
403 } 403 }
404 } 404 }
405 else { 405 else {
406 srv_debug(0, xs_fmt("oauth token: invalid or unset arguments")); 406 srv_debug(1, xs_fmt("oauth token: invalid or unset arguments"));
407 status = 400; 407 status = 400;
408 } 408 }
409 } 409 }
@@ -425,7 +425,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
425 } 425 }
426 else { 426 else {
427 token_del(tokid); 427 token_del(tokid);
428 srv_debug(0, xs_fmt("oauth revoke: revoked token %s", tokid)); 428 srv_debug(1, xs_fmt("oauth revoke: revoked token %s", tokid));
429 status = 200; 429 status = 200;
430 430
431 /* also delete the app, as it serves no purpose from now on */ 431 /* also delete the app, as it serves no purpose from now on */
@@ -433,7 +433,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
433 } 433 }
434 } 434 }
435 else { 435 else {
436 srv_debug(0, xs_fmt("oauth revoke: invalid or unset arguments")); 436 srv_debug(1, xs_fmt("oauth revoke: invalid or unset arguments"));
437 status = 403; 437 status = 403;
438 } 438 }
439 } 439 }
@@ -1611,7 +1611,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
1611 1611
1612 app_add(cid, app); 1612 app_add(cid, app);
1613 1613
1614 srv_debug(0, xs_fmt("mastoapi apps: new app %s", cid)); 1614 srv_debug(1, xs_fmt("mastoapi apps: new app %s", cid));
1615 } 1615 }
1616 } 1616 }
1617 else 1617 else