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")?,
    })
}