pub enum AuthModule {
DatabaseAuthenticatable,
Registerable,
Recoverable,
Rememberable,
Trackable,
Timeoutable,
Validatable,
Confirmable,
Lockable,
Omniauthable,
TwoFactorAuthenticatable,
}Expand description
Devise-style auth modules, declared under auth.modules in config/<env>.yml.
A module toggles a coherent feature — its routes (via the generated
auth_routes! only: list), its migration columns, and its runtime behavior.
strategies (cookie/jwt) are orthogonal: they decide how a request is
authenticated, while modules decide which Devise features are active.
Variants§
DatabaseAuthenticatable
Password authentication (email + password_digest). Effectively required.
Registerable
Sign-up / account registration (registrations routes).
Recoverable
Password reset via emailed token (passwords routes).
Rememberable
“Remember me” persistent cookie (remember_created_at).
Trackable
Sign-in tracking (count, timestamps, IPs).
Timeoutable
Idle session expiry after auth.timeout seconds.
Validatable
Email/password format + length validation on registration.
Confirmable
Email confirmation before sign-in (confirmation routes).
Lockable
Lock an account after repeated failed sign-ins (unlock routes).
Omniauthable
OAuth / social sign-in (oauth routes).
TwoFactorAuthenticatable
TOTP two-factor authentication (requires the auth-2fa feature).
Implementations§
Source§impl AuthModule
impl AuthModule
Sourcepub const ALL: [AuthModule; 11]
pub const ALL: [AuthModule; 11]
All modules, in declaration order.
Sourcepub fn from_name(s: &str) -> Option<AuthModule>
pub fn from_name(s: &str) -> Option<AuthModule>
Parse a module from its snake_case name.
Sourcepub fn route_group(self) -> Option<&'static str>
pub fn route_group(self) -> Option<&'static str>
The auth_routes! route-group name this module mounts, if any.
Behavior-only modules (trackable, timeoutable, rememberable, validatable,
database_authenticatable) return None — they add no dedicated routes.
Trait Implementations§
Source§impl Clone for AuthModule
impl Clone for AuthModule
Source§fn clone(&self) -> AuthModule
fn clone(&self) -> AuthModule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AuthModule
Source§impl Debug for AuthModule
impl Debug for AuthModule
Source§impl<'de> Deserialize<'de> for AuthModule
impl<'de> Deserialize<'de> for AuthModule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for AuthModule
Source§impl PartialEq for AuthModule
impl PartialEq for AuthModule
impl StructuralPartialEq for AuthModule
Auto Trait Implementations§
impl Freeze for AuthModule
impl RefUnwindSafe for AuthModule
impl Send for AuthModule
impl Sync for AuthModule
impl Unpin for AuthModule
impl UnsafeUnpin for AuthModule
impl UnwindSafe for AuthModule
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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