pub struct TwoFactor { /* private fields */ }Expand description
The two-factor plugin: .plugin(TwoFactor::new().issuer("Acme")).
Implementations§
Source§impl TwoFactor
impl TwoFactor
pub fn new() -> Self
Sourcepub fn issuer(self, issuer: impl Into<String>) -> Self
pub fn issuer(self, issuer: impl Into<String>) -> Self
The name authenticator apps show next to the account. Default: the app name.
Sourcepub fn period(self, seconds: u32) -> Self
pub fn period(self, seconds: u32) -> Self
Seconds per TOTP code (default 30). Codes one period early or late are accepted.
Sourcepub fn backup_codes(self, count: usize) -> Self
pub fn backup_codes(self, count: usize) -> Self
How many backup codes enabling or regenerating hands out (default 10).
Sourcepub fn skip_verification_on_enable(self, skip: bool) -> Self
pub fn skip_verification_on_enable(self, skip: bool) -> Self
Turn two-factor on at /two-factor/enable instead of after the first verified code.
Sourcepub fn trust_device_for(self, duration: Duration) -> Self
pub fn trust_device_for(self, duration: Duration) -> Self
How long trustDevice: true skips the challenge on that device (default 30 days).
How long a challenged sign-in may take to verify (default 10 minutes).
Trait Implementations§
Source§impl Plugin for TwoFactor
impl Plugin for TwoFactor
Source§const ID: &'static str = "two-factor"
const ID: &'static str = "two-factor"
Unique id, used in error messages, schema ownership and derived keys.
Source§type Requires = ()
type Requires = ()
Plugins that must be registered before this one, as a tuple:
(), (Organization,).Source§type UserFields = TwoFactorUser
type UserFields = TwoFactorUser
Columns this plugin adds to
user; () for none.Source§type SessionFields = ()
type SessionFields = ()
Columns this plugin adds to
session; () for none.Source§fn schema(&self, schema: &mut SchemaBuilder)
fn schema(&self, schema: &mut SchemaBuilder)
Adds tables (
schema.model::<M>()) or columns. UserFields and SessionFields are
added automatically.Auto Trait Implementations§
impl Forget for TwoFactor
impl Freeze for TwoFactor
impl Move for TwoFactor
impl RefUnwindSafe for TwoFactor
impl Send for TwoFactor
impl Sync for TwoFactor
impl Unpin for TwoFactor
impl UnsafeUnpin for TwoFactor
impl UnwindSafe for TwoFactor
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