seanfarley / emacs-bitwarden

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

Login fails in a specific code path #14

Closed eeowaa closed 1 year ago

eeowaa commented 1 year ago

The bitwarden-login function fails when all of the following conditions are true:

  1. bitwarden-api-client-id is nil
  2. bitwarden-api-secret-key is nil
  3. bitwarden-automatic-unlock is nil or is a function that returns nil

What happens is the :command argument to make-process ends up with a final list element of nil, producing the error Wrong type argument: stringp, nil. The following workaround avoids that error:

(setq bitwarden-automatic-unlock (lambda () ""))

One fix would be to set the let-bound pass variable in bitwarden-login the same way it is set in the bitwarden-unlock function.

seanfarley commented 1 year ago

Oh, yeah, you're probably right (without check the code right now). I need to tighten up that flow control.