pub struct RememberMeServices { /* private fields */ }Expand description
Remember-Me authentication services.
§Spring Security Equivalent
Similar to TokenBasedRememberMeServices in Spring Security.
Provides methods for:
- Creating remember-me cookies on login
- Validating remember-me cookies
- Clearing remember-me cookies on logout
Implementations§
Source§impl RememberMeServices
impl RememberMeServices
Sourcepub fn new(config: RememberMeConfig) -> Self
pub fn new(config: RememberMeConfig) -> Self
Create new remember-me services with the given configuration.
Sourcepub fn login_success(&self, user: &User) -> Cookie<'static>
pub fn login_success(&self, user: &User) -> Cookie<'static>
Create a remember-me cookie for successful login.
§Spring Equivalent
RememberMeServices.loginSuccess()
Sourcepub fn auto_login(&self, cookie_value: &str) -> Option<String>
pub fn auto_login(&self, cookie_value: &str) -> Option<String>
Validate remember-me cookie and return username if valid.
§Spring Equivalent
RememberMeServices.autoLogin()
Sourcepub fn logout(&self) -> Cookie<'static>
pub fn logout(&self) -> Cookie<'static>
Create a cookie that clears the remember-me token (for logout).
§Spring Equivalent
RememberMeServices.logout()
Get the cookie name for reading from request.
Sourcepub fn parameter_name(&self) -> &str
pub fn parameter_name(&self) -> &str
Get the form parameter name.
Sourcepub fn is_always_remember(&self) -> bool
pub fn is_always_remember(&self) -> bool
Check if always remember is enabled.
Sourcepub fn config(&self) -> &RememberMeConfig
pub fn config(&self) -> &RememberMeConfig
Get the configuration.
Trait Implementations§
Source§impl Clone for RememberMeServices
impl Clone for RememberMeServices
Source§fn clone(&self) -> RememberMeServices
fn clone(&self) -> RememberMeServices
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RememberMeServices
impl RefUnwindSafe for RememberMeServices
impl Send for RememberMeServices
impl Sync for RememberMeServices
impl Unpin for RememberMeServices
impl UnwindSafe for RememberMeServices
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more