Microservice to bring 2FA to self hosted PDSes

fixed back button

+13 -3
+13 -3
src/admin/routes.rs
··· 33 33 #[derive(Debug, Deserialize)] 34 34 pub struct AccountsParams { 35 35 pub cursor: Option<String>, 36 + pub prev_cursor: Option<String>, 36 37 pub flash_success: Option<String>, 37 38 pub flash_error: Option<String>, 38 39 } ··· 292 293 let pds = pds_url(&state); 293 294 let password = admin_password(&state); 294 295 295 - let limit = 5; 296 + let limit = 100; 296 297 let limit_as_string = limit.to_string(); 297 298 298 299 let mut repo_infos: std::collections::HashMap<String, (bool, Option<String>)> = ··· 398 399 if let Some(ref cursor) = next_cursor { 399 400 if accounts.len() >= limit { 400 401 data["has_next"] = true.into(); 401 - let next_url = format!("/admin/accounts?cursor={}", urlencoding::encode(cursor)); 402 + let mut next_url = format!("/admin/accounts?cursor={}", urlencoding::encode(cursor)); 403 + if let Some(ref current_cursor) = params.cursor { 404 + next_url.push_str(&format!( 405 + "&prev_cursor={}", 406 + urlencoding::encode(current_cursor) 407 + )); 408 + } 402 409 data["next_url"] = next_url.into(); 403 410 } 404 411 } ··· 406 413 // Pagination: "Previous" link 407 414 if params.cursor.is_some() { 408 415 data["has_prev"] = true.into(); 409 - let prev_url = "/admin/accounts".to_string(); 416 + let mut prev_url = "/admin/accounts".to_string(); 417 + if let Some(ref prev_cursor) = params.prev_cursor { 418 + prev_url.push_str(&format!("?cursor={}", urlencoding::encode(prev_cursor))); 419 + } 410 420 data["prev_url"] = prev_url.into(); 411 421 } 412 422