Can check the validity of a password reset token
This commit is contained in:
@@ -6,24 +6,28 @@ use std::time::Duration;
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub enum RatedAction {
|
||||
CreateAccount,
|
||||
CheckResetPasswordTokenFailed,
|
||||
}
|
||||
|
||||
impl RatedAction {
|
||||
fn id(&self) -> &'static str {
|
||||
match self {
|
||||
RatedAction::CreateAccount => "create-account",
|
||||
RatedAction::CheckResetPasswordTokenFailed => "check-reset-password-token",
|
||||
}
|
||||
}
|
||||
|
||||
fn limit(&self) -> usize {
|
||||
match self {
|
||||
RatedAction::CreateAccount => 5,
|
||||
RatedAction::CheckResetPasswordTokenFailed => 100,
|
||||
}
|
||||
}
|
||||
|
||||
fn keep_seconds(&self) -> u64 {
|
||||
match self {
|
||||
RatedAction::CreateAccount => 3600,
|
||||
RatedAction::CheckResetPasswordTokenFailed => 3600,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user