pub trait DittoAuthenticationEventHandler: Send + Sync {
// Required methods
fn authentication_required(&self, auth: DittoAuthenticator);
fn authentication_expiring_soon(
&self,
auth: DittoAuthenticator,
seconds_remaining: Duration,
);
}Expand description
Implement this trait for a type in order to use
DittoConfigConnect::Server mode with the old callback-based
authentication API.
v5 note: This trait is superseded by DittoAuthExpirationHandler in v5.
Use DittoAuthExpirationHandler with DittoConfigConnect::Server mode instead.
Required Methods§
Sourcefn authentication_required(&self, auth: DittoAuthenticator)
fn authentication_required(&self, auth: DittoAuthenticator)
This will be called when you need to authenticate.
Usually it will involve a call to auth.login.
Sourcefn authentication_expiring_soon(
&self,
auth: DittoAuthenticator,
seconds_remaining: Duration,
)
fn authentication_expiring_soon( &self, auth: DittoAuthenticator, seconds_remaining: Duration, )
Allows for custom behavior hooks when authentication is expiring