mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
passwd: Retype password to confirm
Previously passwd would accept the first password input by the user. It should ask the user to re-type the password to check for mismatches and prevent typos in the password.
This commit is contained in:
parent
b0f8bccd08
commit
4fd842f566
1 changed files with 11 additions and 0 deletions
|
@ -103,6 +103,17 @@ int main(int argc, char** argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto new_password_retype = Core::get_password("Retype new password: ");
|
||||||
|
if (new_password_retype.is_error()) {
|
||||||
|
warnln("{}", new_password_retype.error());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (new_password.value() != new_password_retype.value()) {
|
||||||
|
warnln("Sorry, passwords don't match.");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
target_account.set_password(new_password.value().characters());
|
target_account.set_password(new_password.value().characters());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue