POC in Rust remove authorization in /api/station/register
This commit is contained in:
@@ -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(®ister_racer)
|
||||
.send()
|
||||
|
||||
2
log.json
2
log.json
@@ -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}}]
|
||||
Reference in New Issue
Block a user