Skip to main content

AuthConfirmationHandler

Trait AuthConfirmationHandler 

Source
pub trait AuthConfirmationHandler: Sized {
    // Required method
    fn handle_confirmation(
        self,
        allowed_confirmations: &[ConfirmationMethod],
    ) -> impl Future<Output = Option<ConfirmationAction>> + Send;

    // Provided method
    fn or<Right: AuthConfirmationHandler>(
        self,
        other: Right,
    ) -> EitherConfirmationHandler<Self, Right> { ... }
}
Expand description

A trait for handling login confirmations

The library comes with handlers for:

Additionally, apps can implement the trait to integrate the confirmation flow into the app.

Required Methods§

Source

fn handle_confirmation( self, allowed_confirmations: &[ConfirmationMethod], ) -> impl Future<Output = Option<ConfirmationAction>> + Send

Perform the confirmation action given a list of allowed confirmations for the login

If the confirmation handler supports any of the allowed confirmations, it returns a ConfirmationAction with the required action.

If the confirmation handler does not support any of the allowed confirmations it returns None. If no confirmation handler supports the allowed confirmations the login will fail.

Provided Methods§

Source

fn or<Right: AuthConfirmationHandler>( self, other: Right, ) -> EitherConfirmationHandler<Self, Right>

Return a new confirmation handler that combines the current one with a new one.

The resulting confirmation handler will handle both handler in parallel.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§