pub struct FormLoginConfig { /* private fields */ }Expand description
Form login configuration.
§Spring Security Equivalent
Similar to FormLoginConfigurer in Spring Security.
§Example
ⓘ
let config = FormLoginConfig::new()
.login_page("/login")
.login_processing_url("/login")
.username_parameter("username")
.password_parameter("password")
.default_success_url("/")
.failure_url("/login?error");Implementations§
Source§impl FormLoginConfig
impl FormLoginConfig
Sourcepub fn new() -> FormLoginConfig
pub fn new() -> FormLoginConfig
Create a new form login configuration with default values.
Sourcepub fn login_page(self, url: &str) -> FormLoginConfig
pub fn login_page(self, url: &str) -> FormLoginConfig
Sourcepub fn login_processing_url(self, url: &str) -> FormLoginConfig
pub fn login_processing_url(self, url: &str) -> FormLoginConfig
Set the login processing URL (POST request).
§Spring Equivalent
formLogin().loginProcessingUrl("/login")
Sourcepub fn username_parameter(self, param: &str) -> FormLoginConfig
pub fn username_parameter(self, param: &str) -> FormLoginConfig
Sourcepub fn password_parameter(self, param: &str) -> FormLoginConfig
pub fn password_parameter(self, param: &str) -> FormLoginConfig
Sourcepub fn default_success_url(self, url: &str) -> FormLoginConfig
pub fn default_success_url(self, url: &str) -> FormLoginConfig
Sourcepub fn always_use_default_success_url(self, always: bool) -> FormLoginConfig
pub fn always_use_default_success_url(self, always: bool) -> FormLoginConfig
Always redirect to default success URL, ignoring saved request.
§Spring Equivalent
formLogin().defaultSuccessUrl("/", true)
Sourcepub fn failure_url(self, url: &str) -> FormLoginConfig
pub fn failure_url(self, url: &str) -> FormLoginConfig
Sourcepub fn logout_url(self, url: &str) -> FormLoginConfig
pub fn logout_url(self, url: &str) -> FormLoginConfig
Sourcepub fn logout_success_url(self, url: &str) -> FormLoginConfig
pub fn logout_success_url(self, url: &str) -> FormLoginConfig
Sourcepub fn remember_me_parameter(self, param: &str) -> FormLoginConfig
pub fn remember_me_parameter(self, param: &str) -> FormLoginConfig
Enable remember-me with the given parameter name.
Sourcepub fn get_login_page(&self) -> &str
pub fn get_login_page(&self) -> &str
Get the login page URL.
Sourcepub fn get_login_processing_url(&self) -> &str
pub fn get_login_processing_url(&self) -> &str
Get the login processing URL.
Sourcepub fn get_username_parameter(&self) -> &str
pub fn get_username_parameter(&self) -> &str
Get the username parameter name.
Sourcepub fn get_password_parameter(&self) -> &str
pub fn get_password_parameter(&self) -> &str
Get the password parameter name.
Sourcepub fn get_default_success_url(&self) -> &str
pub fn get_default_success_url(&self) -> &str
Get the default success URL.
Sourcepub fn is_always_use_default_success_url(&self) -> bool
pub fn is_always_use_default_success_url(&self) -> bool
Check if always use default success URL.
Sourcepub fn get_failure_url(&self) -> &str
pub fn get_failure_url(&self) -> &str
Get the failure URL.
Sourcepub fn get_logout_url(&self) -> &str
pub fn get_logout_url(&self) -> &str
Get the logout URL.
Sourcepub fn get_logout_success_url(&self) -> &str
pub fn get_logout_success_url(&self) -> &str
Get the logout success URL.
Sourcepub fn get_remember_me_parameter(&self) -> Option<&str>
pub fn get_remember_me_parameter(&self) -> Option<&str>
Get the remember-me parameter name.
Trait Implementations§
Source§impl Clone for FormLoginConfig
impl Clone for FormLoginConfig
Source§fn clone(&self) -> FormLoginConfig
fn clone(&self) -> FormLoginConfig
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 moreSource§impl Default for FormLoginConfig
impl Default for FormLoginConfig
Source§fn default() -> FormLoginConfig
fn default() -> FormLoginConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FormLoginConfig
impl RefUnwindSafe for FormLoginConfig
impl Send for FormLoginConfig
impl Sync for FormLoginConfig
impl Unpin for FormLoginConfig
impl UnwindSafe for FormLoginConfig
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