diff --git a/mastoapi.c b/mastoapi.c index c333573..4396155 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -162,7 +162,7 @@ const char *login_page = "" "\n" "

%s OAuth identify

\n" "
%s
\n" -"
\n" +"\n" "

Login:

\n" "

Password:

\n" "\n" @@ -208,7 +208,8 @@ int oauth_get_handler(const xs_dict *req, const char *q_path, if (xs_is_null(state)) state = ""; - *body = xs_fmt(login_page, host, "", host, ruri, cid, state, USER_AGENT); + *body = xs_fmt(login_page, host, "", host, "oauth/x-snac-login", + ruri, cid, state, USER_AGENT); *ctype = "text/html"; status = 200; @@ -264,7 +265,8 @@ int oauth_post_handler(const xs_dict *req, const char *q_path, const char *host = xs_dict_get(srv_config, "host"); /* by default, generate another login form with an error */ - *body = xs_fmt(login_page, host, "LOGIN INCORRECT", host, redir, cid, state, USER_AGENT); + *body = xs_fmt(login_page, host, "LOGIN INCORRECT", host, "oauth/x-snac-login", + redir, cid, state, USER_AGENT); *ctype = "text/html"; status = 200; @@ -273,8 +275,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path, if (user_open(&snac, login)) { /* check the login + password */ - if (check_password(login, passwd, - xs_dict_get(snac.config, "passwd"))) { + if (check_password(login, passwd, xs_dict_get(snac.config, "passwd"))) { /* success! redirect to the desired uri */ xs *code = random_str();