Renamed one new basic auth function, improved doxy

This commit is contained in:
Evgeny Grin (Karlson2k)
2023-10-06 14:12:31 +03:00
parent 596cc4b1cb
commit ce38b0fa79
6 changed files with 68 additions and 65 deletions
+8 -8
View File
@@ -45,10 +45,10 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
static const char *page =
"<html><body>Authorization required</body></html>";
response = MHD_create_response_from_buffer_static (strlen (page), page);
ret = MHD_queue_basic_auth_fail_response3 (connection,
"admins",
MHD_YES,
response);
ret = MHD_queue_basic_auth_required_response3 (connection,
"admins",
MHD_YES,
response);
}
else if ((strlen ("root") != auth_info->username_len) ||
(0 != memcmp (auth_info->username, "root",
@@ -63,10 +63,10 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
static const char *page =
"<html><body>Wrong username or password</body></html>";
response = MHD_create_response_from_buffer_static (strlen (page), page);
ret = MHD_queue_basic_auth_fail_response3 (connection,
"admins",
MHD_YES,
response);
ret = MHD_queue_basic_auth_required_response3 (connection,
"admins",
MHD_YES,
response);
}
else
{
+4 -4
View File
@@ -89,10 +89,10 @@ ask_for_authentication (struct MHD_Connection *connection, const char *realm)
if (! response)
return MHD_NO;
ret = MHD_queue_basic_auth_fail_response3 (connection,
realm,
MHD_YES,
response);
ret = MHD_queue_basic_auth_required_response3 (connection,
realm,
MHD_YES,
response);
MHD_destroy_response (response);
return ret;
}