aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-08 18:48:58 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-08 18:48:58 +0100
commit7176bd3c94950e9aa0731cc4f9bb266974dd59da (patch)
tree3e4b1a9166f5da198b6e7e82e73e8f599cd67f4b
parente37a0248e865db2d69c89d5c7bd8651dae255cab (diff)
downloadslcl-7176bd3c94950e9aa0731cc4f9bb266974dd59da.tar.gz
Call page_forbidden on invalid auth
-rw-r--r--main.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/main.c b/main.c
index 2256fe7..c46d6fc 100644
--- a/main.c
+++ b/main.c
@@ -483,24 +483,7 @@ static int getnode(const struct http_payload *const p,
if (auth_cookie(a, &p->cookie))
{
fprintf(stderr, "%s: auth_cookie failed\n", __func__);
-
- *r = (const struct http_response)
- {
- .status = HTTP_STATUS_SEE_OTHER
- };
-
- if (http_response_add_header(r, "Location", "/"))
- {
- fprintf(stderr, "%s: http_response_add_header failed\n", __func__);
- return -1;
- }
- else if (http_response_add_header(r, "Content-Type", "text/html"))
- {
- fprintf(stderr, "%s: http_response_add_header failed\n", __func__);
- return -1;
- }
-
- return 0;
+ return page_forbidden(r);
}
const char *const username = p->cookie.field,