commit 3931640

Kelson Vibber  ·  2023-09-21 01:16:13 +0000 UTC
parent d9b6688
Put hostname in OAuth page title for web-based clients like Elk
1 files changed,  +5, -5
+5, -5
 1@@ -149,7 +149,7 @@ const char *login_page = ""
 2 "<!DOCTYPE html>\n"
 3 "<html>\n"
 4 "<head>\n"
 5-"<title>OAuth Identify: Snac2</title>\n"
 6+"<title>%s OAuth - Snac2</title>\n"
 7 "<style>:root {color-scheme: light dark}</style>\n"
 8 "</head>\n"
 9 "<body><h1>%s OAuth identify</h1>\n"
10@@ -195,7 +195,7 @@ int oauth_get_handler(const xs_dict *req, const char *q_path,
11                 if (xs_is_null(state))
12                     state = "";
13 
14-                *body  = xs_fmt(login_page, host, "", host, "oauth/x-snac-login",
15+                *body  = xs_fmt(login_page, host, host, "", host, "oauth/x-snac-login",
16                                 ruri, cid, state, USER_AGENT);
17                 *ctype = "text/html";
18                 status = 200;
19@@ -212,7 +212,7 @@ int oauth_get_handler(const xs_dict *req, const char *q_path,
20     if (strcmp(cmd, "/x-snac-get-token") == 0) { /** **/
21         const char *host = xs_dict_get(srv_config, "host");
22 
23-        *body  = xs_fmt(login_page, host, "", host, "oauth/x-snac-get-token",
24+        *body  = xs_fmt(login_page, host, host, "", host, "oauth/x-snac-get-token",
25                         "", "", "", USER_AGENT);
26         *ctype = "text/html";
27         status = 200;
28@@ -262,7 +262,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
29         const char *host = xs_dict_get(srv_config, "host");
30 
31         /* by default, generate another login form with an error */
32-        *body  = xs_fmt(login_page, host, "LOGIN INCORRECT", host, "oauth/x-snac-login",
33+        *body  = xs_fmt(login_page, host, host, "LOGIN INCORRECT", host, "oauth/x-snac-login",
34                         redir, cid, state, USER_AGENT);
35         *ctype = "text/html";
36         status = 200;
37@@ -431,7 +431,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
38         const char *host = xs_dict_get(srv_config, "host");
39 
40         /* by default, generate another login form with an error */
41-        *body  = xs_fmt(login_page, host, "LOGIN INCORRECT", host, "oauth/x-snac-get-token",
42+        *body  = xs_fmt(login_page, host, host, "LOGIN INCORRECT", host, "oauth/x-snac-get-token",
43                         "", "", "", USER_AGENT);
44         *ctype = "text/html";
45         status = 200;