diff options
| author | 2023-09-21 01:16:13 +0000 | |
|---|---|---|
| committer | 2023-09-21 01:16:13 +0000 | |
| commit | 3931640b6983ffcd1279669b1ed247ef80858a70 (patch) | |
| tree | 2891f58bf3d41cacf17d8bfa7d6f811201e0a047 /mastoapi.c | |
| parent | Add title to OAuth page for web-based clients like Elk (diff) | |
| download | snac2-3931640b6983ffcd1279669b1ed247ef80858a70.tar.gz snac2-3931640b6983ffcd1279669b1ed247ef80858a70.tar.xz snac2-3931640b6983ffcd1279669b1ed247ef80858a70.zip | |
Put hostname in OAuth page title for web-based clients like Elk
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -149,7 +149,7 @@ const char *login_page = "" | |||
| 149 | "<!DOCTYPE html>\n" | 149 | "<!DOCTYPE html>\n" |
| 150 | "<html>\n" | 150 | "<html>\n" |
| 151 | "<head>\n" | 151 | "<head>\n" |
| 152 | "<title>OAuth Identify: Snac2</title>\n" | 152 | "<title>%s OAuth - Snac2</title>\n" |
| 153 | "<style>:root {color-scheme: light dark}</style>\n" | 153 | "<style>:root {color-scheme: light dark}</style>\n" |
| 154 | "</head>\n" | 154 | "</head>\n" |
| 155 | "<body><h1>%s OAuth identify</h1>\n" | 155 | "<body><h1>%s OAuth identify</h1>\n" |
| @@ -195,7 +195,7 @@ int oauth_get_handler(const xs_dict *req, const char *q_path, | |||
| 195 | if (xs_is_null(state)) | 195 | if (xs_is_null(state)) |
| 196 | state = ""; | 196 | state = ""; |
| 197 | 197 | ||
| 198 | *body = xs_fmt(login_page, host, "", host, "oauth/x-snac-login", | 198 | *body = xs_fmt(login_page, host, host, "", host, "oauth/x-snac-login", |
| 199 | ruri, cid, state, USER_AGENT); | 199 | ruri, cid, state, USER_AGENT); |
| 200 | *ctype = "text/html"; | 200 | *ctype = "text/html"; |
| 201 | status = 200; | 201 | status = 200; |
| @@ -212,7 +212,7 @@ int oauth_get_handler(const xs_dict *req, const char *q_path, | |||
| 212 | if (strcmp(cmd, "/x-snac-get-token") == 0) { /** **/ | 212 | if (strcmp(cmd, "/x-snac-get-token") == 0) { /** **/ |
| 213 | const char *host = xs_dict_get(srv_config, "host"); | 213 | const char *host = xs_dict_get(srv_config, "host"); |
| 214 | 214 | ||
| 215 | *body = xs_fmt(login_page, host, "", host, "oauth/x-snac-get-token", | 215 | *body = xs_fmt(login_page, host, host, "", host, "oauth/x-snac-get-token", |
| 216 | "", "", "", USER_AGENT); | 216 | "", "", "", USER_AGENT); |
| 217 | *ctype = "text/html"; | 217 | *ctype = "text/html"; |
| 218 | status = 200; | 218 | status = 200; |
| @@ -262,7 +262,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path, | |||
| 262 | const char *host = xs_dict_get(srv_config, "host"); | 262 | const char *host = xs_dict_get(srv_config, "host"); |
| 263 | 263 | ||
| 264 | /* by default, generate another login form with an error */ | 264 | /* by default, generate another login form with an error */ |
| 265 | *body = xs_fmt(login_page, host, "LOGIN INCORRECT", host, "oauth/x-snac-login", | 265 | *body = xs_fmt(login_page, host, host, "LOGIN INCORRECT", host, "oauth/x-snac-login", |
| 266 | redir, cid, state, USER_AGENT); | 266 | redir, cid, state, USER_AGENT); |
| 267 | *ctype = "text/html"; | 267 | *ctype = "text/html"; |
| 268 | status = 200; | 268 | status = 200; |
| @@ -431,7 +431,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path, | |||
| 431 | const char *host = xs_dict_get(srv_config, "host"); | 431 | const char *host = xs_dict_get(srv_config, "host"); |
| 432 | 432 | ||
| 433 | /* by default, generate another login form with an error */ | 433 | /* by default, generate another login form with an error */ |
| 434 | *body = xs_fmt(login_page, host, "LOGIN INCORRECT", host, "oauth/x-snac-get-token", | 434 | *body = xs_fmt(login_page, host, host, "LOGIN INCORRECT", host, "oauth/x-snac-get-token", |
| 435 | "", "", "", USER_AGENT); | 435 | "", "", "", USER_AGENT); |
| 436 | *ctype = "text/html"; | 436 | *ctype = "text/html"; |
| 437 | status = 200; | 437 | status = 200; |