1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-26 07:19:22 +00:00

Mark new field as to remove

This commit is contained in:
Pierre HUBERT 2021-02-13 14:48:35 +01:00
parent 985abc3e99
commit becd54e8c6
3 changed files with 12 additions and 5 deletions

View File

@ -11,13 +11,18 @@ struct LoginTokens {
#[derive(Serialize, Deserialize)]
pub struct LoginSuccess {
success: String,
token: String,
// TODO : remove
tokens: LoginTokens,
success: String,
}
impl LoginSuccess {
pub fn new(token: &str) -> LoginSuccess {
LoginSuccess {
token: token.to_string(),
success: "Login successful".to_string(),
tokens: LoginTokens {
token1: token.to_string(),

View File

@ -134,12 +134,12 @@ pub fn get_routes() -> Vec<Route> {
// Account controller
Route::limited_post_without_login("/account/create", Box::new(account_controller::create), LimitPolicy::SUCCESS(10)),
Route::limited_post_without_login("/account/login", Box::new(account_controller::login_user), LimitPolicy::FAILURE(10)),
Route::limited_post_without_login("/user/connectUSER", Box::new(account_controller::login_user), LimitPolicy::FAILURE(10)),
Route::limited_post_without_login("/user/connectUSER", Box::new(account_controller::login_user), LimitPolicy::FAILURE(10)), // TODO : remove
Route::post("/account/logout", Box::new(account_controller::logout_user)),
Route::post("/user/disconnectUSER", Box::new(account_controller::logout_user)),
Route::post("/user/disconnectUSER", Box::new(account_controller::logout_user)), // TODO : remove
Route::post("/account/disconnect_all_devices", Box::new(account_controller::disconnect_all_devices)),
Route::post("/account/id", Box::new(account_controller::user_id)),
Route::post("/user/getCurrentUserID", Box::new(account_controller::user_id)),
Route::post("/user/getCurrentUserID", Box::new(account_controller::user_id)), // TODO : remove
Route::limited_post_without_login("/account/exists_email", Box::new(account_controller::exists_mail), LimitPolicy::ANY(30)),
Route::limited_post_without_login("/account/has_security_questions", Box::new(account_controller::has_security_questions), LimitPolicy::FAILURE(10)),
Route::limited_post_without_login("/account/get_security_questions", Box::new(account_controller::get_security_questions), LimitPolicy::FAILURE(10)),

View File

@ -78,6 +78,7 @@ impl HttpRequestHandler {
/// Check API client tokens
pub fn check_client_token(&mut self) -> RequestResult {
// TODO : remove fallback
let client_name = self.post_string_with_fallback("client", "serviceName")?;
let client = self.ok_or_bad_request(
@ -111,7 +112,8 @@ impl HttpRequestHandler {
/// Check login token
pub fn check_user_token(&mut self) -> Res {
let token = self.post_string("userToken1")?;
// TODO : remove fallback
let token = self.post_string_with_fallback("token", "userToken1")?;
// Find user
match account_helper::find_user_by_login_token(&token, self.api_client()) {