diff options
author | default <nobody@localhost> | 2023-12-05 05:47:53 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-12-05 05:47:53 +0100 |
commit | 756b0c98ee7ae36f28c166dee286e177cfe62f19 (patch) | |
tree | 9f3aac83961ae14d6d59b1915192398ee8cd1656 | |
parent | 04e51516d35e574ec33c35b4882800dcbc404e45 (diff) |
mastoapi: correctly print the auth key in the sepcial urn:ietf... case.
-rw-r--r-- | mastoapi.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -279,8 +279,14 @@ int oauth_post_handler(const xs_dict *req, const char *q_path, xs *code = random_str(); xs_free(*body); - *body = xs_fmt("%s?code=%s", redir, code); - status = 303; + + if (strcmp(redir, "urn:ietf:wg:oauth:2.0:oob") == 0) { + *body = xs_dup(code); + } + else { + *body = xs_fmt("%s?code=%s", redir, code); + status = 303; + } /* if there is a state, add it */ if (!xs_is_null(state) && *state) { |