Struct actix_identity::config::IdentityMiddlewareBuilder
source · pub struct IdentityMiddlewareBuilder { /* private fields */ }
Expand description
A fluent builder to construct an IdentityMiddleware
instance with custom configuration
parameters.
Use IdentityMiddleware::builder
to get started!
Implementations§
source§impl IdentityMiddlewareBuilder
impl IdentityMiddlewareBuilder
sourcepub fn id_key(self, key: &'static str) -> Self
pub fn id_key(self, key: &'static str) -> Self
Set a custom key to identify the user in the session.
sourcepub fn last_visit_unix_timestamp_key(self, key: &'static str) -> Self
pub fn last_visit_unix_timestamp_key(self, key: &'static str) -> Self
Set a custom key to store the last visited unix timestamp.
sourcepub fn login_unix_timestamp_key(self, key: &'static str) -> Self
pub fn login_unix_timestamp_key(self, key: &'static str) -> Self
Set a custom key to store the login unix timestamp.
sourcepub fn logout_behaviour(self, logout_behaviour: LogoutBehaviour) -> Self
pub fn logout_behaviour(self, logout_behaviour: LogoutBehaviour) -> Self
Determines how Identity::logout
affects the current session.
By default, the current session is purged (LogoutBehaviour::PurgeSession
).
sourcepub fn login_deadline(self, deadline: Option<Duration>) -> Self
pub fn login_deadline(self, deadline: Option<Duration>) -> Self
Automatically logs out users after a certain amount of time has passed since they logged in, regardless of their activity pattern.
If set to:
None
: login deadline is disabled.Some(duration)
: login deadline is enabled and users will be logged out afterduration
has passed since their login.
By default, login deadline is disabled.
sourcepub fn visit_deadline(self, deadline: Option<Duration>) -> Self
pub fn visit_deadline(self, deadline: Option<Duration>) -> Self
Automatically logs out users after a certain amount of time has passed since their last visit.
If set to:
None
: visit deadline is disabled.Some(duration)
: visit deadline is enabled and users will be logged out afterduration
has passed since their last visit.
By default, visit deadline is disabled.
sourcepub fn build(self) -> IdentityMiddleware
pub fn build(self) -> IdentityMiddleware
Finalises the builder and returns an IdentityMiddleware
instance.
Trait Implementations§
source§impl Clone for IdentityMiddlewareBuilder
impl Clone for IdentityMiddlewareBuilder
source§fn clone(&self) -> IdentityMiddlewareBuilder
fn clone(&self) -> IdentityMiddlewareBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more