vaultwarden/src/api/core/two_factor
Stefan Melmuk 2c36993792
enforce 2FA policy on removal of second factor and login (#3803)
* enforce 2fa policy on removal of second factor

users should be revoked when their second factors are removed.

we want to revoke users so they don't have to be invited again and
organization admins and owners are aware that they no longer have
access.

we make an exception for non-confirmed users to speed up the invitation
process as they would have to be restored before they can accept their
invitation or be confirmed.

if email is enabled, invited users have to add a second factor before
they can accept the invitation to an organization with 2fa policy.
and if it is not enabled that check is done when confirming the user.

* use &str instead of String in log_event()

* enforce the 2fa policy on login

if a user doesn't have a second factor check if they are in an
organization that has the 2fa policy enabled to revoke their access
2024-01-01 19:41:40 +01:00
..
authenticator.rs Add Protected Actions Check (#4067) 2023-11-12 22:15:44 +01:00
duo.rs Add Protected Actions Check (#4067) 2023-11-12 22:15:44 +01:00
email.rs Add Protected Actions Check (#4067) 2023-11-12 22:15:44 +01:00
mod.rs enforce 2FA policy on removal of second factor and login (#3803) 2024-01-01 19:41:40 +01:00
protected_actions.rs Add Protected Actions Check (#4067) 2023-11-12 22:15:44 +01:00
webauthn.rs Add Protected Actions Check (#4067) 2023-11-12 22:15:44 +01:00
yubikey.rs Add Protected Actions Check (#4067) 2023-11-12 22:15:44 +01:00