diff options
| author | 2023-12-05 05:47:53 +0100 | |
|---|---|---|
| committer | 2023-12-05 05:47:53 +0100 | |
| commit | 756b0c98ee7ae36f28c166dee286e177cfe62f19 (patch) | |
| tree | 9f3aac83961ae14d6d59b1915192398ee8cd1656 /mastoapi.c | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-756b0c98ee7ae36f28c166dee286e177cfe62f19.tar.gz snac2-756b0c98ee7ae36f28c166dee286e177cfe62f19.tar.xz snac2-756b0c98ee7ae36f28c166dee286e177cfe62f19.zip | |
mastoapi: correctly print the auth key in the sepcial urn:ietf... case.
Diffstat (limited to 'mastoapi.c')
| -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, | |||
| 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) { |