Check email
This commit is contained in:
parent
0bfdc305b1
commit
bce6a85536
26
geneit_backend/Cargo.lock
generated
26
geneit_backend/Cargo.lock
generated
@ -302,6 +302,12 @@ version = "1.0.71"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
|
||||
|
||||
[[package]]
|
||||
name = "ascii_utils"
|
||||
version = "0.9.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a"
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.1.0"
|
||||
@ -570,6 +576,15 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fast_chemail"
|
||||
version = "0.9.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "495a39d30d624c2caabe6312bfead73e7717692b44e0b32df168c275a2e8e9e4"
|
||||
dependencies = [
|
||||
"ascii_utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.26"
|
||||
@ -650,6 +665,7 @@ dependencies = [
|
||||
"env_logger",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"mailchecker",
|
||||
"serde",
|
||||
]
|
||||
|
||||
@ -868,6 +884,16 @@ dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mailchecker"
|
||||
version = "5.0.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c64fa7af9860896bdfe496f323ac278f256006fd248dd7730e37c5faa648b05"
|
||||
dependencies = [
|
||||
"fast_chemail",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.5.0"
|
||||
|
@ -14,4 +14,5 @@ anyhow = "1.0.71"
|
||||
actix-web = "4.3.1"
|
||||
diesel = { version = "2.0.4", features = ["postgres"] }
|
||||
serde = { version = "1.0.163", features = ["derive"] }
|
||||
actix-remote-ip = "0.1.0"
|
||||
actix-remote-ip = "0.1.0"
|
||||
mailchecker = "5.0.9"
|
@ -17,7 +17,10 @@ pub async fn create_account(
|
||||
) -> actix_web::Result<HttpResponse> {
|
||||
// TODO : rate limiting
|
||||
|
||||
// TODO : check if email is valid
|
||||
// Check if email is valid
|
||||
if !mailchecker::is_valid(&req.email) {
|
||||
return Ok(HttpResponse::BadRequest().json("Email address is invalid!"));
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
let constraints = StaticConstraints::default();
|
||||
|
Loading…
Reference in New Issue
Block a user