]> git.proxmox.com Git - proxmox-perl-rs.git/commitdiff
pmg: reset tfa failure count on unlock
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 5 Jul 2023 09:01:45 +0000 (11:01 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 5 Jul 2023 09:01:45 +0000 (11:01 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
pmg-rs/src/tfa.rs

index d4282bc1a878024a6659c9163e63a99a38b2278f..19244887d920b3182daa28f66fb9e9109b9c461b 100644 (file)
@@ -439,9 +439,11 @@ mod export {
     }
 
     #[export]
-    fn api_unlock_tfa(#[try_from_ref] this: &Tfa, userid: &str) -> Result<bool, Error> {
-        Ok(methods::unlock_tfa(
+    fn api_unlock_tfa(#[raw] raw_this: Value, userid: &str) -> Result<bool, Error> {
+        let this: &Tfa = (&raw_this).try_into()?;
+        Ok(methods::unlock_and_reset_tfa(
             &mut this.inner.lock().unwrap(),
+            &UserAccess::new(&raw_this)?,
             userid,
         )?)
     }