Align policy enforcement and status codes with Bitwarden (#7970)

This commit is contained in:
Tom authored and GitHub committed 2026-11-15 21:20:46 +01:00
1 parent 00611ea80d
commit 4051a4d3a6
6 files changed
+95 -41

No files matched your search

+1 -1
View File
@@ -535,7 +535,7 @@ async fn remove_2fa(user_id: UserId, token: AdminToken, conn: DbConn) -> EmptyRe
let mut user = get_user_or_404(&user_id, &conn).await?;
TwoFactor::delete_all_by_user(&user.uuid, &conn).await?;
Device::clear_twofactor_remember_by_user(&user.uuid, &conn).await?;
two_factor::enforce_2fa_policy(&user, &ACTING_ADMIN_USER.into(), 14, &token.ip.ip, &conn).await?;
two_factor::enforce_2fa_policy(&user, &ACTING_ADMIN_USER.into(), 14, &token.ip.ip, true, &conn).await?;
user.totp_recover = None;
user.save(&conn).await
}