seanfarley / emacs-bitwarden

Emacs Bitwarden command wrapper.
GNU General Public License v3.0
50 stars 13 forks source link

Invalidate Session on bitwarden-lock #16

Closed HyperSuperMetaCtrl closed 1 year ago

HyperSuperMetaCtrl commented 1 year ago

The Code before this just set the env variable BW_SESSION to nil. This deletes the session key but leaves it valid, so it can basically act as a master key.

This commit fixes this by actually calling the bw lock command and therefore invalidating the session key and setting the variable BW_SESSION to nil no matter if the vault is still unlocked. This way the function can get called multiple times and the vault stays locked and the env variable stays empty even when the vault was locked by i.e. another terminal

Note vterm keeps the env variable until it is exited (not just minimized).

seanfarley commented 1 year ago

Ah, yeah, this is more correct behavior than I originally had. Thanks!