diff --git a/crates/ezidam/src/routes/root.rs b/crates/ezidam/src/routes/root.rs index a2bc456..a538b07 100644 --- a/crates/ezidam/src/routes/root.rs +++ b/crates/ezidam/src/routes/root.rs @@ -41,7 +41,5 @@ pub mod content { #[derive(Serialize)] #[serde(crate = "rocket::serde")] #[derive(Clone)] - pub struct ResetPassword { - pub username: String, - } + pub struct ResetPassword {} } diff --git a/crates/ezidam/src/routes/root/reset_password.rs b/crates/ezidam/src/routes/root/reset_password.rs index 6b15765..41367cb 100644 --- a/crates/ezidam/src/routes/root/reset_password.rs +++ b/crates/ezidam/src/routes/root/reset_password.rs @@ -12,13 +12,11 @@ pub async fn reset_password_page( return Err(Error::bad_request("Reset password token has expired")); } - let user = User::get_one_from_password_reset_token(&mut **db, &token.0) + User::get_one_from_password_reset_token(&mut **db, &token.0) .await? .ok_or_else(|| Error::not_found("Invalid or expired token"))?; - let page = Page::ResetPassword(super::content::ResetPassword { - username: user.username().into(), - }); + let page = Page::ResetPassword(super::content::ResetPassword {}); Ok(flash .map(|flash| Page::with_flash(page.clone(), flash)) diff --git a/crates/ezidam/static/i18n/en.json b/crates/ezidam/static/i18n/en.json index f20d51b..2292c28 100644 --- a/crates/ezidam/static/i18n/en.json +++ b/crates/ezidam/static/i18n/en.json @@ -10,12 +10,16 @@ "setup.settings": "settings", "setup.base_url": "Base URL", "setup.finish": "Finish setup", - "forgot_password.title": "Reset your password", + "forgot_password.title": "Forgot password", "forgot_password.email": "Email", "forgot_password.paper_key": "Paper key", "forgot_password.email_description": "Enter your email address linked to your account. We will email you a link to reset your password.", "forgot_password.email_address": "Email address", "forgot_password.request": "Request password reset", "forgot_password.paper_key_description": "Enter your login linked to your account, with your paper key.", - "forgot_password.login": "Login" + "forgot_password.login": "Login", + "reset_password.title": "Reset your password", + "reset_password.new_password": "New password", + "reset_password.confirm_password": "Confirm new password", + "reset_password.set_password": "Set new password" } \ No newline at end of file diff --git a/crates/ezidam/static/i18n/fr.json b/crates/ezidam/static/i18n/fr.json index 99fb4be..654d942 100644 --- a/crates/ezidam/static/i18n/fr.json +++ b/crates/ezidam/static/i18n/fr.json @@ -10,12 +10,16 @@ "setup.settings": "réglages", "setup.base_url": "URL de base", "setup.finish": "Terminer la configuration", - "forgot_password.title": "Réinitialisation du mot de passe", + "forgot_password.title": "Mot de passe oublié", "forgot_password.email": "Email", "forgot_password.paper_key": "Clé papier", "forgot_password.email_description": "Entrez l'adresse email associée à votre compte. Nous allons vous envoyer par email un lien pour réinitialiser votre mot de passe.", "forgot_password.email_address": "Adresse email", "forgot_password.request": "Demander réinitialisation du mot de passe", "forgot_password.paper_key_description": "Entrez votre nom d'utilisateur, ainsi que votre clé papier.", - "forgot_password.login": "Nom d'utilisateur" + "forgot_password.login": "Nom d'utilisateur", + "reset_password.title": "Réinitialisation du mot de passe", + "reset_password.new_password": "Nouveau mot de passe", + "reset_password.confirm_password": "Confirmer le mot de passe", + "reset_password.set_password": "Enregistrer le mot de passe" } diff --git a/crates/ezidam/templates/pages/reset-password.html.tera b/crates/ezidam/templates/pages/reset-password.html.tera index 899b79f..4bd2289 100644 --- a/crates/ezidam/templates/pages/reset-password.html.tera +++ b/crates/ezidam/templates/pages/reset-password.html.tera @@ -16,27 +16,25 @@ {% endif %} -
Resetting password for {{ username }}