mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 22:45:05 +00:00
Only allow logged-in user to use statuses API
This commit is contained in:
parent
15137fc5c7
commit
fb5f34bb5a
1 changed files with 82 additions and 78 deletions
|
@ -1510,6 +1510,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
|||
else
|
||||
if (xs_startswith(cmd, "/v1/statuses/")) { /** **/
|
||||
/* information about a status */
|
||||
if (logged_in) {
|
||||
xs *l = xs_split(cmd, "/");
|
||||
const char *id = xs_list_get(l, 3);
|
||||
const char *op = xs_list_get(l, 4);
|
||||
|
@ -1607,6 +1608,9 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
status = 401;
|
||||
}
|
||||
else
|
||||
if (strcmp(cmd, "/v1/preferences") == 0) { /** **/
|
||||
*body = xs_dup("{}");
|
||||
|
|
Loading…
Reference in a new issue