keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
20.17k stars 1.42k forks source link

Confirmation before closing password generator popup #10831

Open Jookia opened 1 month ago

Jookia commented 1 month ago

Summary

When I generate a new password for an account, I click the dice icon, spend time tuning the features, set the password in my online account, then close the dialog, losing the password. There's a task interruption in between generating the password and creating an account and verifying the password actually works at the service. By the time I have everything set up I just close the window, because that's what I usually do when viewing passwords, creating passwords is fairly rare.

It would be very nice if it asked me if I was sure I wanted to re-roll the dice or close without applying.

Examples

I don't have any examples or pictures.

Context

I'm a human and make mistakes, and this seems like a small feature that would reduce mistakes. If this is an easy feature I would be more than happy to have a go at implementing it.

Another solution might be to just have a temporary log of all diced passwords, but that seems like a bit of a security hazard as you'd have to make sure to clear it.

droidmonkey commented 1 month ago

We could do this, might be annoying though. Generally when I apply a new or updated password I just generate one and accept it right away.

Jookia commented 1 month ago

Maybe it could be opt-out? It's a bit tough because you don't want to annoy the user. But the action of closing the window can't be undone and the password can't be recreated so it's a high risk operation.

droidmonkey commented 1 month ago

High risk, but entirely in your control. There is a request open for a more formal password changing process.

Jookia commented 1 month ago

Where?

droidmonkey commented 1 month ago

6323

Jookia commented 1 month ago

I can't comment on that issue.

Looks like other people are hitting this issue:

https://github.com/keepassxreboot/keepassxc/issues/7297 https://github.com/keepassxreboot/keepassxc/issues/8415

Would you accept a PR for adding a confirmation dialog on close? Perhaps a confirmation before the password changes if you click a tab too?

droidmonkey commented 1 month ago

Switching tabs should not re generate a new password, I agree that is an unexpected bug. I'd be open to a confirmation dialog if you click the top-right X to close the dialog but not if you press Cancel.

Jookia commented 1 month ago

I'll have a go at implementing that when I get time, and maybe work on fixing the tab switch issue if I can.

I feel like the intended workflow here is to save before use, including saving the database. But the problem that people like me hit is sometimes the password needs tweaking after trying to enter it in to a service. So perhaps the correct solution is to save generations to a 'shadow password' in the database, and re-opening the password generator would show this password and allow you to continue generation or accepting.