From d3b4b10d18572ff0a6e1568481ec65f4317a4346 Mon Sep 17 00:00:00 2001 From: Jean-Christophe BEGUE Date: Fri, 10 Aug 2018 16:59:23 +0200 Subject: [PATCH] Add a explaination to the password hint message #85 --- src/api/core/accounts.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs index 41cccaae..e45c08dc 100644 --- a/src/api/core/accounts.rs +++ b/src/api/core/accounts.rs @@ -263,7 +263,10 @@ fn password_hint(data: JsonUpcase, conn: DbConn) -> EmptyResul } match User::find_by_mail(&data.Email, &conn) { - Some(user) => err!(user.password_hint.to_owned().unwrap_or("".to_string())), + Some(user) => { + let hint = user.password_hint.to_owned().unwrap_or_default(); + err!(format!("Your password hint is: {}", hint)) + }, None => Ok(()), } }