POC in Rust remove authorization in /api/station/register

This commit is contained in:
Martin Quarda
2025-05-10 17:56:17 +02:00
parent 1957ff7f9f
commit 2a89528b8f
2 changed files with 3 additions and 15 deletions

View File

@@ -57,24 +57,12 @@ struct RegisterRacer{
}
async fn station_register(card_id: usize, time: DateTime::<Local>) -> Result<(), reqwest::Error>{
let client = reqwest::Client::builder()
.cookie_store(true)
.build()
.unwrap();
let result = client
.post(CONFIG.HOST.clone() + "/api/login")
.form(&[
("login", CONFIG.LOGIN.as_str()),
("password", CONFIG.PASSWORD.as_str()),
]);
.send()
.await?;
let register_racer = RegisterRacer{
card_id: card_id,
station_id: CONFIG.STATION_ID,
time: format!("{}", time.format("%d.%m.%Y %H:%M:%S.%f")),
time: format!("{}", time.format("%d.%m.%Y %H:%M:%S.%6f")),
};
client
Client::new()
.post(CONFIG.HOST.clone() + "/api/station/register")
.json(&register_racer)
.send()

View File

@@ -1 +1 @@
[]
[{"url": "https://beta.alkator.cz/api/card/register", "json": {"racer_id": 60, "starting_number": 2, "card_id": 1364550814, "time": "10.05.2025 17:40:13.486403"}}, {"url": "https://beta.alkator.cz/api/station/register", "json": {"card_id": 1364550814, "time": "10.05.2025 17:42:45.425016", "station_id": 1}}]