mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-02-20 16:02:39 +00:00
21 lines
624 B
Rust
21 lines
624 B
Rust
|
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())
|
||
|
}
|