Просмотр исходного кода

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 3 месяцев назад
Родитель
Сommit
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))
                     rsp = xs_dict_append(rsp, "scope", scope);
+                else
+                    rsp = xs_dict_append(rsp, "scope", "");
 
                 *body  = xs_json_dumps(rsp, 4);
                 *ctype = "application/json";