mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-10 03:50:38 +03:00
Only allow logged-in user to use statuses API
This commit is contained in:
parent
15137fc5c7
commit
fb5f34bb5a
@ -1510,6 +1510,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
|||||||
else
|
else
|
||||||
if (xs_startswith(cmd, "/v1/statuses/")) { /** **/
|
if (xs_startswith(cmd, "/v1/statuses/")) { /** **/
|
||||||
/* information about a status */
|
/* information about a status */
|
||||||
|
if (logged_in) {
|
||||||
xs *l = xs_split(cmd, "/");
|
xs *l = xs_split(cmd, "/");
|
||||||
const char *id = xs_list_get(l, 3);
|
const char *id = xs_list_get(l, 3);
|
||||||
const char *op = xs_list_get(l, 4);
|
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
|
else
|
||||||
if (strcmp(cmd, "/v1/preferences") == 0) { /** **/
|
if (strcmp(cmd, "/v1/preferences") == 0) { /** **/
|
||||||
*body = xs_dup("{}");
|
*body = xs_dup("{}");
|
||||||
|
Loading…
Reference in New Issue
Block a user