Skip to main content

LoginWithCredentialsCallbacks

Struct LoginWithCredentialsCallbacks 

Source
pub struct LoginWithCredentialsCallbacks<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure> {
    pub fetch_credentials: FetchCredentials,
    pub verify_password: VerifyPassword,
    pub dummy_password_hash: DummyPasswordHash,
    pub build_user: BuildUser,
    pub on_two_factor: OnTwoFactor,
    pub on_success: OnSuccess,
    pub on_failure: OnFailure,
}
Expand description

Collects the callbacks needed to authenticate a login request.

Fields§

§fetch_credentials: FetchCredentials

Loads stored credentials for the normalized login identifier.

§verify_password: VerifyPassword

Verifies the submitted password against the stored password hash.

§dummy_password_hash: DummyPasswordHash

Valid hash used when the normalized identifier has no account.

It must use the same algorithm and comparable cost as real hashes so negative lookups cannot be distinguished by skipping password work.

§build_user: BuildUser

Converts the authenticated account into the application’s session user.

§on_two_factor: OnTwoFactor

Runs application-owned work when the account requires two-factor authentication.

§on_success: OnSuccess

Runs application-owned work after a complete successful login.

§on_failure: OnFailure

Runs application-owned cleanup after invalid credentials.

Auto Trait Implementations§

§

impl<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure> Freeze for LoginWithCredentialsCallbacks<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure>
where FetchCredentials: Freeze, VerifyPassword: Freeze, BuildUser: Freeze, OnTwoFactor: Freeze, OnSuccess: Freeze, OnFailure: Freeze,

§

impl<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure> RefUnwindSafe for LoginWithCredentialsCallbacks<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure>
where FetchCredentials: RefUnwindSafe, VerifyPassword: RefUnwindSafe, BuildUser: RefUnwindSafe, OnTwoFactor: RefUnwindSafe, OnSuccess: RefUnwindSafe, OnFailure: RefUnwindSafe,

§

impl<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure> Send for LoginWithCredentialsCallbacks<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure>
where FetchCredentials: Send, VerifyPassword: Send, BuildUser: Send, OnTwoFactor: Send, OnSuccess: Send, OnFailure: Send,

§

impl<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure> Sync for LoginWithCredentialsCallbacks<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure>
where FetchCredentials: Sync, VerifyPassword: Sync, BuildUser: Sync, OnTwoFactor: Sync, OnSuccess: Sync, OnFailure: Sync,

§

impl<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure> Unpin for LoginWithCredentialsCallbacks<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure>
where FetchCredentials: Unpin, VerifyPassword: Unpin, BuildUser: Unpin, OnTwoFactor: Unpin, OnSuccess: Unpin, OnFailure: Unpin,

§

impl<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure> UnsafeUnpin for LoginWithCredentialsCallbacks<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure>
where FetchCredentials: UnsafeUnpin, VerifyPassword: UnsafeUnpin, BuildUser: UnsafeUnpin, OnTwoFactor: UnsafeUnpin, OnSuccess: UnsafeUnpin, OnFailure: UnsafeUnpin,

§

impl<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure> UnwindSafe for LoginWithCredentialsCallbacks<FetchCredentials, VerifyPassword, BuildUser, OnTwoFactor, OnSuccess, OnFailure>
where FetchCredentials: UnwindSafe, VerifyPassword: UnwindSafe, BuildUser: UnwindSafe, OnTwoFactor: UnwindSafe, OnSuccess: UnwindSafe, OnFailure: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more