Преглед на файлове

Send a scope with the token

Mastodon API includes sope with a token.
Send an empty value if we don't have a scope.
trondd555 преди 7 месеца
родител
ревизия
8084252f27
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      mastoapi.c

+ 2 - 0
mastoapi.c

@@ -412,6 +412,8 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
 
 
                 if (!xs_is_null(scope))
                 if (!xs_is_null(scope))
                     rsp = xs_dict_append(rsp, "scope", scope);
                     rsp = xs_dict_append(rsp, "scope", scope);
+                else
+                    rsp = xs_dict_append(rsp, "scope", "");
 
 
                 *body  = xs_json_dumps(rsp, 4);
                 *body  = xs_json_dumps(rsp, 4);
                 *ctype = "application/json";
                 *ctype = "application/json";