···1717- Session destruction (`/api/session/destroy`)
1818- Simple file upload (`/api/upload`) with quota checking
1919- Simple redirect from (`/favicon.ico`) to the strawmelonjuice.png file
2020+- User info retrieval from ('/api/user/fetch')
202121222223### โ **Missing from Rust:**
···2627 - [x] Admins see all files, regular users see only their own
2728 - [ ] Returns file sizes in MB
28292929-2. **`/api/user/fetch` - User Info Retrieval**
3030- - Returns current user details (username, quotas, admin status)
3131- - Excludes password hash
3232-3333-3. **`/api/files/delete` - File Deletion**
3030+2. **`/api/files/delete` - File Deletion**
3431 - Deletes files with permission checking
3532 - Updates user quotas
3633 - Cleans up physical files and directories
37343838-4. **`/api/upload-streamed` - WebSocket Upload**
3535+3. **`/api/upload-streamed` - WebSocket Upload**
3936 - Handles large file uploads via WebSocket
4037 - Chunks data to avoid memory issues
4138 - Real-time quota validation during upload
42394343-5. **Automatic Sample File Creation**
4040+4. **Automatic Sample File Creation**
4441 - TS version downloads strawmelonjuice.png from strawmelonjuice.com
4542 - Rust version doesn't have this initialization
4643
+2
server-rs/src/main.rs
···4545 // /api/files -> lists all files for authenticated users.
4646 // (admins see all, users just their own)
4747 routes::api::list_files,
4848+ // /api/user/fetch -> return current user details (excluding password hash)
4949+ routes::api::fetch_user,
4850 ],
4951 )
5052 .manage(app)
+27-1
server-rs/src/routes/api.rs
···259259 });
260260}
261261262262-struct User {
262262+#[derive(Serialize)]
263263+#[serde(crate = "rocket::serde")]
264264+pub(crate) struct User {
263265 id: Uuid,
264266 username: String,
265267 max_megabytes: i64,
···275277 filename: String,
276278 size_mb: i32,
277279}
280280+281281+#[post("/user/fetch", data = "<single_identify>")]
282282+pub(crate) async fn fetch_user(
283283+ single_identify: Json<SingleIdentify>,
284284+ app: &State<App>,
285285+) -> Result<Json<User>, (Status, &'static str)> {
286286+ // Validate the session
287287+ let sid = match Uuid::parse_str(&single_identify.session) {
288288+ Ok(v) => v,
289289+ Err(_) => return Err((Status::BadRequest, "Invalid session ID format.")),
290290+ };
291291+ let user_id = match app.validate_session(sid).await {
292292+ Ok(v) => v,
293293+ Err(_) => return Err((Status::Unauthorized, "Invalid session token.")),
294294+ };
295295+296296+ // get the user data from the id
297297+ let user = match user_from_id(&app.db, user_id).await {
298298+ Ok(v) => v,
299299+ Err(_) => return Err((Status::NotFound, "Couldn't find the user for session id")),
300300+ };
301301+302302+ Ok(Json(user))
303303+}