diff options
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) { |