Skip to content

feat(user-management): add one time code too many attempts error #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/user_management/types/authenticate_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ pub enum AuthenticateErrorWithCode {
message: String,
},

/// One-time code too many attempts error
#[error("one_time_code_too_many_attempts: {message}")]
OneTimeCodeTooManyAttempts {
/// A human-readable message describing the error.
message: String,
},

/// Organization selection required error
///
/// This error indicates that the user is a member of multiple organizations and must select which organization to sign in to.
Expand Down Expand Up @@ -154,6 +161,9 @@ impl AuthenticateErrorWithCode {
AuthenticateErrorWithCode::MfaEnrollment { .. } => "mfa_enrollment",
AuthenticateErrorWithCode::MfaChallenge { .. } => "mfa_challenge",
AuthenticateErrorWithCode::OneTimeCodeExpired { .. } => "one_time_code_expired",
AuthenticateErrorWithCode::OneTimeCodeTooManyAttempts { .. } => {
"one_time_code_too_many_attempts"
}
AuthenticateErrorWithCode::OrganizationSelectionRequired { .. } => {
"organization_selection_required"
}
Expand All @@ -171,6 +181,7 @@ impl AuthenticateErrorWithCode {
AuthenticateErrorWithCode::MfaEnrollment { message, .. } => message,
AuthenticateErrorWithCode::MfaChallenge { message, .. } => message,
AuthenticateErrorWithCode::OneTimeCodeExpired { message } => message,
AuthenticateErrorWithCode::OneTimeCodeTooManyAttempts { message } => message,
AuthenticateErrorWithCode::OrganizationSelectionRequired { message, .. } => message,
AuthenticateErrorWithCode::Other { message, .. } => message,
}
Expand Down