1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-02-20 16:02:39 +00:00
comunicapiv3/src/helpers/account_helper.rs

21 lines
624 B
Rust
Raw Normal View History

2020-05-23 19:17:48 +02:00
use crate::data::api_client::APIClient;
use crate::data::error::ResultBoxError;
use crate::helpers::user_helper;
/// Account helper
///
/// @author Pierre Hubert
/// Attempt to sign-in user
///
/// In this version of the api, we consider that there is only one login token required
/// This is why I returns just a simple string, the token created for the user in case of success
pub fn login_user(email: &str, password: &str, client: &APIClient) -> ResultBoxError<String> {
let user = user_helper::find_user_by_email(email)?;
// TODO : check user password
println!("{:#?}", user);
Ok("d".to_string())
}