From 2fe5ecd53e3a24b2f0bb9b8e3f2982419994c0cd Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Wed, 16 Sep 2026 22:17:31 -0500 Subject: [PATCH] Fix issue --- src/router/user.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/router/user.rs b/src/router/user.rs index a817f51..ae5fcf7 100644 --- a/src/router/user.rs +++ b/src/router/user.rs @@ -195,9 +195,11 @@ pub async fn announcement(Login(key): Login) -> impl Responder { })) } -async fn get_migration_code(Body(body): Body) -> impl Responder { - - let Some(user_id) = body["user_id"].as_i64() else { return Api(None); }; +async fn get_migration_code(Session { key, .. }: Session) -> impl Responder { + let user_id = userdata::uid_from_login_token(&key); + if user_id == 0 { + return Api(None); + } let code = userdata::user::migration::get_acc_token(user_id); Api(Some(object!{