mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
Only allow logged-in user to use search API
This commit is contained in:
parent
2b64892e83
commit
15137fc5c7
1 changed files with 31 additions and 27 deletions
|
@ -1627,6 +1627,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
|||
}
|
||||
else
|
||||
if (strcmp(cmd, "/v2/search") == 0) { /** **/
|
||||
if (logged_in) {
|
||||
const char *q = xs_dict_get(args, "q");
|
||||
const char *type = xs_dict_get(args, "type");
|
||||
const char *offset = xs_dict_get(args, "offset");
|
||||
|
@ -1665,6 +1666,9 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
|||
*ctype = "application/json";
|
||||
status = 200;
|
||||
}
|
||||
else
|
||||
status = 401;
|
||||
}
|
||||
|
||||
/* user cleanup */
|
||||
if (logged_in)
|
||||
|
|
Loading…
Reference in a new issue