mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-14 17:45:04 +00:00
mastoapi: correctly print the auth key in the sepcial urn:ietf... case.
This commit is contained in:
parent
04e51516d3
commit
756b0c98ee
1 changed files with 8 additions and 2 deletions
10
mastoapi.c
10
mastoapi.c
|
@ -279,8 +279,14 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
|
||||||
xs *code = random_str();
|
xs *code = random_str();
|
||||||
|
|
||||||
xs_free(*body);
|
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 there is a state, add it */
|
||||||
if (!xs_is_null(state) && *state) {
|
if (!xs_is_null(state) && *state) {
|
||||||
|
|
Loading…
Reference in a new issue