- pub fn register(conn: &mut PgConnection, form: &LocalUserForm) -> Result<Self, Error> {
- let mut edited_user = form.clone();
- let password_hash = form
- .password_encrypted
- .as_ref()
- .map(|p| hash(p, DEFAULT_COST).expect("Couldn't hash password"));
- edited_user.password_encrypted = password_hash;
-
- Self::create(conn, &edited_user)
- }
-