mvdan / bitw

Minimalist BitWarden client
BSD 3-Clause "New" or "Revised" License
169 stars 15 forks source link

Unable to login if more than one 2FA is setup #12

Closed pschmitt closed 3 years ago

pschmitt commented 4 years ago

So here's what happened:

export EMAIL=test@example.com
bitw sync
Password:
error: expected one two-factor auth provider, found 2

Technically more than 1 2FA can be set up. In my case that'd be TOTP + Email.

https://github.com/mvdan/bitw/blob/7b76ea2eb9c7fecb6de92e30d8a3e3cbb30569ff/auth.go#L93-L95

mvdan commented 4 years ago

Ah, I simply haven't implemented this, as I didn't need it :) A patch is welcome, if you'd like to work on this. It shouldn't be hard.

If the server has any way to specify which 2FA method the user prefers, we could pick that.

Alternatively, we could allow the config to set that up, or ask the user interactively if no default has been set up.