fix
This commit is contained in:
@@ -106,19 +106,19 @@ pub async fn auth(
|
||||
|
||||
pub fn render_password_form(key: &str, filename: &str, error: bool) -> Response {
|
||||
let message = if error {
|
||||
"<p class=\"err\">Mot de passe incorrect. Réessayez.</p>"
|
||||
"<p class=\"err\">Incorrect password. Please try again.</p>"
|
||||
} else {
|
||||
""
|
||||
};
|
||||
let safe_filename = escape_html(filename);
|
||||
let html = format!(
|
||||
r#"<!doctype html>
|
||||
<html lang="fr">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<title>Fichier protégé</title>
|
||||
<title>Protected file</title>
|
||||
<style>
|
||||
* {{ box-sizing: border-box; }}
|
||||
body {{
|
||||
@@ -153,12 +153,12 @@ pub fn render_password_form(key: &str, filename: &str, error: bool) -> Response
|
||||
<img src="/logo.svg" alt="logo" />
|
||||
<span>File Drop</span>
|
||||
</div>
|
||||
<h1>Fichier protégé</h1>
|
||||
<p>Entrez le mot de passe pour télécharger <strong>{safe_filename}</strong>.</p>
|
||||
<h1>Protected file</h1>
|
||||
<p>Enter the password to download <strong>{safe_filename}</strong>.</p>
|
||||
{message}
|
||||
<form method="post" action="/api/auth/{key}">
|
||||
<input type="password" name="password" placeholder="Mot de passe" autofocus autocomplete="off" />
|
||||
<button type="submit">Télécharger</button>
|
||||
<input type="password" name="password" placeholder="Password" autofocus autocomplete="off" />
|
||||
<button type="submit">Download</button>
|
||||
</form>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user