tsk-61: Registration configuration #73

Merged
phoenix merged 8 commits from tsk-61 into main 2025-10-20 16:48:49 +00:00
Showing only changes of commit 34687dda7d - Show all commits

View File

@@ -52,6 +52,7 @@ pub async fn register_user(
axum::Extension(pool): axum::Extension<sqlx::PgPool>,
Json(payload): Json<request::Request>,
) -> (StatusCode, Json<response::Response>) {
if is_registration_enabled() {
let mut user = icarus_models::user::User {
username: payload.username.clone(),
password: payload.password.clone(),
@@ -115,4 +116,10 @@ pub async fn register_user(
}),
),
}
} else {
(axum::http::StatusCode::NOT_ACCEPTABLE, Json(response::Response{
message: String::from("Registration is not enabled"),
data:: Vec::new()
}))
}
}