pub struct TwoFactorResource<'a> { /* private fields */ }Expand description
client.two_factor()
Implementations§
Source§impl<'a> TwoFactorResource<'a>
impl<'a> TwoFactorResource<'a>
Sourcepub fn totp(
&self,
body: &PersonTwoFactorVerify,
) -> Result<PostTwofactorTotpData>
pub fn totp( &self, body: &PersonTwoFactorVerify, ) -> Result<PostTwofactorTotpData>
Verify an authenticator code during enrollment
POST /twofactor/totp
Checks a code against the stored authenticator secret for the current person. Only the current person may verify their own secret. Initialization must have completed first. A successful call returns status=success and records the code as used; it does not enable two-factor authentication. Call PUT /persons/{personId}/settings/twofactor separately to activate. Missing secrets, invalid codes and codes already recorded as used produce 400. Keep the code as a string to preserve leading zeroes.
§Example
let body = models::PersonTwoFactorVerify {
code: "012345".into(),
person_id: 42,
..Default::default()
};
let two_factor = client.two_factor().totp(&body)?;
println!("{}", two_factor.status);Trait Implementations§
Source§impl<'a> Clone for TwoFactorResource<'a>
impl<'a> Clone for TwoFactorResource<'a>
impl<'a> Copy for TwoFactorResource<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for TwoFactorResource<'a>
impl<'a> !UnwindSafe for TwoFactorResource<'a>
impl<'a> Freeze for TwoFactorResource<'a>
impl<'a> Send for TwoFactorResource<'a>
impl<'a> Sync for TwoFactorResource<'a>
impl<'a> Unpin for TwoFactorResource<'a>
impl<'a> UnsafeUnpin for TwoFactorResource<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more