aboutsummaryrefslogtreecommitdiff
path: root/src/validation/login.rs
blob: e40bb23cb044f87db0408cdb0de5c47b687f9817 (plain)
1
2
3
4
5
6
7
8
9
10
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")?,
    })
}