tuwunel_api/oidc/device/
error.rs1use const_str::format as const_format;
2use tuwunel_core::utils::html::escape as html_escape;
3
4use super::DEVICE_HEAD;
5
6pub(super) fn error_html(message: &str) -> String {
7 PAGE_HTML.replace("{msg}", &html_escape(message))
8}
9
10static PAGE_HTML: &str = const_format!(
11 r#"
12<!DOCTYPE html>
13<html lang="en">
14 <head>
15 {DEVICE_HEAD}
16 <title>Error</title>
17 </head>
18 <body>
19 <h1 class="err">Error</h1>
20 <p>{{msg}}</p>
21 <div class="nav">
22 <a href="/_tuwunel/oidc/device">Try again</a>
23 </div>
24 </body>
25</html>"#
26);