mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 16:03:31 +00:00
fixed token type on post marker
This commit is contained in:
@@ -14,8 +14,8 @@ pub(crate) mod markers {
|
|||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
structs::{LoginInfo, Marker},
|
structs::Marker,
|
||||||
util::{blocking_fetch_auth_token, parse_marker_to_payload},
|
util::parse_marker_to_payload,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn get(placeholder: String) -> &'static str {
|
pub fn get(placeholder: String) -> &'static str {
|
||||||
@@ -33,17 +33,10 @@ pub(crate) mod markers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn post_debug(data: Vec<Marker>) -> String {
|
pub fn post_debug(data: Vec<Marker>) -> String {
|
||||||
let parsed_address = data[0].api_address.clone() + "/api/markers";
|
|
||||||
let token_parsed_address = data[0].api_address.clone() + "/api/login";
|
|
||||||
let client = reqwest::blocking::Client::new();
|
let client = reqwest::blocking::Client::new();
|
||||||
|
|
||||||
let authentication_token = blocking_fetch_auth_token(
|
let authentication_token = data[0].api_auth_token.clone();
|
||||||
LoginInfo {
|
let parsed_address: String = data[0].api_address.clone() + "/api/markers?auth_token=" + &authentication_token;
|
||||||
username: data[0].api_auth_username.clone(),
|
|
||||||
password: data[0].api_auth_password.clone(),
|
|
||||||
},
|
|
||||||
token_parsed_address,
|
|
||||||
);
|
|
||||||
|
|
||||||
let mut status: String = "fetching".to_string();
|
let mut status: String = "fetching".to_string();
|
||||||
|
|
||||||
@@ -62,7 +55,6 @@ pub(crate) mod markers {
|
|||||||
.post(parsed_address)
|
.post(parsed_address)
|
||||||
.body(request_body)
|
.body(request_body)
|
||||||
.header("Content-Type", "application/json")
|
.header("Content-Type", "application/json")
|
||||||
.header("X-CSRF-Token", authentication_token)
|
|
||||||
.send();
|
.send();
|
||||||
|
|
||||||
match response {
|
match response {
|
||||||
|
|||||||
Reference in New Issue
Block a user