diff options
author | Joris | 2021-01-03 13:40:40 +0100 |
---|---|---|
committer | Joris | 2021-01-03 13:54:20 +0100 |
commit | 11052951b74b9ad4b6a9412ae490086235f9154b (patch) | |
tree | 64526ac926c1bf470ea113f6cac8a33158684e8d /src/validation/login.rs | |
parent | 371449b0e312a03162b78797b83dee9d81706669 (diff) |
Rewrite in Rust
Diffstat (limited to 'src/validation/login.rs')
-rw-r--r-- | src/validation/login.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/validation/login.rs b/src/validation/login.rs new file mode 100644 index 0000000..e40bb23 --- /dev/null +++ b/src/validation/login.rs @@ -0,0 +1,11 @@ +use std::collections::HashMap; + +use crate::model::login::Login; +use crate::validation::utils::*; + +pub fn login(form: &HashMap<String, String>) -> Option<Login> { + Some(Login { + email: non_empty(form, "email")?, + password: non_empty(form, "password")?, + }) +} |