mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 10:48:53 +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
Notes:
sideshowbarker
2024-07-18 12:06:51 +09:00
Author: https://github.com/brapru
Commit: 4fd842f566
Pull-request: https://github.com/SerenityOS/serenity/pull/7454
Reviewed-by: https://github.com/awesomekling
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