/* SPDX-License-Identifier: GPL-3.0-only */ #include "web_login_ui.h" #include /* Authored standalone page; no dependency on protected or generated assets. */ static const char s_login_html[] = "\n\n\n" "\n" "\n" "Sign in - ESP32 Serial Console\n" "\n\n\n
\n" "

ESP32 Serial Console

\n" "

Sign in to access the serial terminal.

\n" "
\n" "\n" "\n" "\n" "\n" "\n" "
\n" "

Ready to sign in.

\n" "\n" "

Return to console

\n" "Sessions expire after one hour, including active serial connections. " "To switch accounts, return to the console and sign out first.\n" "
\n\n\n\n"; esp_err_t web_login_ui_send_response(httpd_req_t *request) { if (request == NULL) return ESP_ERR_INVALID_ARG; esp_err_t error = httpd_resp_set_type(request, "text/html; charset=utf-8"); if (error == ESP_OK) error = httpd_resp_set_hdr(request, "Cache-Control", "no-store"); if (error == ESP_OK) error = httpd_resp_set_hdr(request, "X-Content-Type-Options", "nosniff"); if (error == ESP_OK) error = httpd_resp_set_hdr(request, "Referrer-Policy", "no-referrer"); if (error == ESP_OK) error = httpd_resp_set_hdr(request, "X-Frame-Options", "DENY"); if (error == ESP_OK) error = httpd_resp_set_hdr(request, "Content-Security-Policy", "default-src 'none'; script-src 'sha256-x70ID2kbifGBVYfh/pePTt5v/AVHkT7JVAV0LjT1wCo='; " "style-src 'unsafe-inline'; connect-src 'self'; base-uri 'none'; " "form-action 'none'; frame-ancestors 'none'"); if (error == ESP_OK) error = httpd_resp_send(request, s_login_html, sizeof(s_login_html) - 1U); return error; }