Move migration related userdata functions to a new file

This commit is contained in:
Ethan O'Brien
2025-12-24 14:34:13 -06:00
parent 816589ae22
commit 15155bd8df
5 changed files with 83 additions and 70 deletions

View File

@@ -217,7 +217,7 @@ pub fn register_password(req: HttpRequest, body: String) -> Option<JsonValue> {
let user = userdata::get_acc(&key);
let code = uid_to_code(user["user"]["id"].to_string());
userdata::save_acc_transfer(&code, &body["pass"].to_string());
userdata::user::migration::save_acc_transfer(&code, &body["pass"].to_string());
Some(array![])
}
@@ -227,7 +227,7 @@ pub fn verify_migration_code(_req: HttpRequest, body: String) -> Option<JsonValu
let uid = code_to_uid(body["migrationCode"].to_string()).parse::<i64>().unwrap_or(0);
let user = userdata::get_acc_transfer(uid, &body["migrationCode"].to_string(), &body["pass"].to_string());
let user = userdata::user::migration::get_acc_transfer(uid, &body["migrationCode"].to_string(), &body["pass"].to_string());
if !user["success"].as_bool().unwrap() || uid == 0 {
return None;
@@ -247,7 +247,7 @@ pub fn request_migration_code(_req: HttpRequest, body: String) -> Option<JsonVal
let uid = code_to_uid(body["migrationCode"].to_string()).parse::<i64>().unwrap_or(0);
let user = userdata::get_acc_transfer(uid, &body["migrationCode"].to_string(), &body["pass"].to_string());
let user = userdata::user::migration::get_acc_transfer(uid, &body["migrationCode"].to_string(), &body["pass"].to_string());
if !user["success"].as_bool().unwrap() || uid == 0 {
return None;