pub struct TwoFactor { /* private fields */ }Expand description
A panel’s two-factor sign-in, installed with Auth::two_factor:
each signed-in user may add an authenticator app, or codes by email when the panel mails them,
at {prefix}/two-factor, and an account that has one signs in with a code from it after its
password.
use tablo_core::{Auth, TwoFactor};
let auth = Auth::password().two_factor(TwoFactor::new().required());Implementations§
Source§impl TwoFactor
impl TwoFactor
Sourcepub fn required(self) -> Self
pub fn required(self) -> Self
Sends a signed-in user without a second factor to {prefix}/two-factor before anything
else: a page answers with a redirect to it and any other request with 403, after an
unverified address.
Sourcepub fn email_codes(self) -> Self
pub fn email_codes(self) -> Self
Lets a user with an address choose codes mailed to it in place of an authenticator app:
each sign-in mails one, through Auth::mail, which mounting then
requires. A mailed code works once, for ten minutes.
Sourcepub fn mail_throttle(self, throttle: LoginThrottle) -> Self
pub fn mail_throttle(self, throttle: LoginThrottle) -> Self
How many codes one account may have mailed in a window; defaults to three in fifteen minutes.
Sourcepub fn throttle(self, throttle: LoginThrottle) -> Self
pub fn throttle(self, throttle: LoginThrottle) -> Self
How many codes one account may try in a window, from any client, at sign-in and on the settings page together; defaults to five a minute.