mirror of
https://github.com/dani-garcia/vaultwarden
synced 2024-11-16 06:52:07 +01:00
Save None instead of empty password hint
This commit is contained in:
parent
9e63985b28
commit
e2ab2f7306
1 changed files with 4 additions and 1 deletions
|
@ -82,7 +82,10 @@ fn post_profile(data: JsonUpcase<ProfileData>, headers: Headers, conn: DbConn) -
|
||||||
let mut user = headers.user;
|
let mut user = headers.user;
|
||||||
|
|
||||||
user.name = data.Name;
|
user.name = data.Name;
|
||||||
user.password_hint = data.MasterPasswordHint;
|
user.password_hint = match data.MasterPasswordHint {
|
||||||
|
Some(ref h) if h.is_empty() => None,
|
||||||
|
_ => data.MasterPasswordHint,
|
||||||
|
};
|
||||||
user.save(&conn);
|
user.save(&conn);
|
||||||
|
|
||||||
Ok(Json(user.to_json(&conn)))
|
Ok(Json(user.to_json(&conn)))
|
||||||
|
|
Loading…
Reference in a new issue