Verify Email + Reset Password flows (#654)

* verifiers

* add missing emails

* fix gh perms
This commit is contained in:
Geometrically
2023-07-12 20:40:24 -07:00
committed by GitHub
parent 4bdf9bff3a
commit 0d88ff8dae
12 changed files with 1228 additions and 476 deletions

View File

@@ -72,6 +72,8 @@ pub enum ApiError {
PasswordHashing(#[from] argon2::password_hash::Error),
#[error("Password strength checking error: {0}")]
PasswordStrengthCheck(#[from] zxcvbn::ZxcvbnError),
#[error("{0}")]
Mail(#[from] crate::auth::email::MailError),
}
impl actix_web::ResponseError for ApiError {
@@ -97,6 +99,7 @@ impl actix_web::ResponseError for ApiError {
ApiError::ImageParse(..) => StatusCode::BAD_REQUEST,
ApiError::PasswordHashing(..) => StatusCode::INTERNAL_SERVER_ERROR,
ApiError::PasswordStrengthCheck(..) => StatusCode::BAD_REQUEST,
ApiError::Mail(..) => StatusCode::INTERNAL_SERVER_ERROR,
}
}
@@ -123,6 +126,7 @@ impl actix_web::ResponseError for ApiError {
ApiError::ImageParse(..) => "invalid_image",
ApiError::PasswordHashing(..) => "password_hashing_error",
ApiError::PasswordStrengthCheck(..) => "strength_check_error",
ApiError::Mail(..) => "mail_error",
},
description: &self.to_string(),
})