summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 11c2671..46a6eab 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -279,8 +279,14 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
279 xs *code = random_str(); 279 xs *code = random_str();
280 280
281 xs_free(*body); 281 xs_free(*body);
282 *body = xs_fmt("%s?code=%s", redir, code); 282
283 status = 303; 283 if (strcmp(redir, "urn:ietf:wg:oauth:2.0:oob") == 0) {
284 *body = xs_dup(code);
285 }
286 else {
287 *body = xs_fmt("%s?code=%s", redir, code);
288 status = 303;
289 }
284 290
285 /* if there is a state, add it */ 291 /* if there is a state, add it */
286 if (!xs_is_null(state) && *state) { 292 if (!xs_is_null(state) && *state) {