pub struct TwoFactorApi<'a, S: AuthSchema> { /* private fields */ }Expand description
Server-only Two Factor endpoints bound to this instance’s registered options. These operations have no public HTTP routes.
Implementations§
Source§impl<'a, S: AuthSchema> TwoFactorApi<'a, S>
impl<'a, S: AuthSchema> TwoFactorApi<'a, S>
Sourcepub fn from_context(context: &'a AuthContext<S>) -> AuthResult<Self>
pub fn from_context(context: &'a AuthContext<S>) -> AuthResult<Self>
Bind to the plugin configuration installed on this auth instance.
Sourcepub fn with_request(self, source: NativeRequest<'a>) -> Self
pub fn with_request(self, source: NativeRequest<'a>) -> Self
Preserve an explicit native Request for dynamic runtime resolution.
Sourcepub async fn generate_totp(&self, body: Option<Value>) -> AuthResult<String>
pub async fn generate_totp(&self, body: Option<Value>) -> AuthResult<String>
Validate a native body and generate a TOTP using the registered digit and period options.
Sourcepub async fn view_backup_codes(
&self,
body: Option<Value>,
) -> AuthResult<Vec<String>>
pub async fn view_backup_codes( &self, body: Option<Value>, ) -> AuthResult<Vec<String>>
Validate and coerce the supplied user ID, then read the stored backup codes.
Auto Trait Implementations§
impl<'a, S> !RefUnwindSafe for TwoFactorApi<'a, S>
impl<'a, S> !UnwindSafe for TwoFactorApi<'a, S>
impl<'a, S> Freeze for TwoFactorApi<'a, S>where
&'a AuthContext<S>: Freeze,
impl<'a, S> Send for TwoFactorApi<'a, S>where
&'a AuthContext<S>: Send,
impl<'a, S> Sync for TwoFactorApi<'a, S>where
&'a AuthContext<S>: Sync,
impl<'a, S> Unpin for TwoFactorApi<'a, S>where
&'a AuthContext<S>: Unpin,
impl<'a, S> UnsafeUnpin for TwoFactorApi<'a, S>where
&'a AuthContext<S>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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