pub struct TwoFactorApi<'a, A> { /* private fields */ }Expand description
Calls the two-factor endpoints without HTTP. headers are the request’s: their cookies
carry the session, or the pending sign-in for verify_totp.
Implementations§
Source§impl<A: AuthInstance> TwoFactorApi<'_, A>
impl<A: AuthInstance> TwoFactorApi<'_, A>
Sourcepub async fn enable(
&self,
headers: &HeaderMap,
input: EnableInput,
) -> Result<ApiResponse<EnableOutput>, AuthError>
pub async fn enable( &self, headers: &HeaderMap, input: EnableInput, ) -> Result<ApiResponse<EnableOutput>, AuthError>
POST /two-factor/enable.
Sourcepub async fn disable(
&self,
headers: &HeaderMap,
input: PasswordInput,
) -> Result<ApiResponse<Status>, AuthError>
pub async fn disable( &self, headers: &HeaderMap, input: PasswordInput, ) -> Result<ApiResponse<Status>, AuthError>
POST /two-factor/disable.
Sourcepub async fn verify_totp(
&self,
headers: &HeaderMap,
input: VerifyInput,
) -> Result<ApiResponse<VerifyOutput>, AuthError>
pub async fn verify_totp( &self, headers: &HeaderMap, input: VerifyInput, ) -> Result<ApiResponse<VerifyOutput>, AuthError>
POST /two-factor/verify-totp. The response’s cookies carry a new session when this
finishes a sign-in.
Auto Trait Implementations§
impl<'a, A> Forget for TwoFactorApi<'a, A>
impl<'a, A> Freeze for TwoFactorApi<'a, A>
impl<'a, A> Move for TwoFactorApi<'a, A>
impl<'a, A> RefUnwindSafe for TwoFactorApi<'a, A>where
&'a A: RefUnwindSafe,
impl<'a, A> Send for TwoFactorApi<'a, A>
impl<'a, A> Sync for TwoFactorApi<'a, A>
impl<'a, A> Unpin for TwoFactorApi<'a, A>
impl<'a, A> UnsafeUnpin for TwoFactorApi<'a, A>where
&'a A: UnsafeUnpin,
impl<'a, A> UnwindSafe for TwoFactorApi<'a, A>where
&'a A: UnwindSafe,
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