add bearer tokens for functions

This commit is contained in:
smanylov
2026-06-02 11:39:54 +07:00
parent 743db57bb3
commit 7d0fb265d4
7 changed files with 42 additions and 19 deletions
+9 -7
View File
@@ -23,8 +23,6 @@ export async function getUserData() {
}
});
console.log(response);
if (response.ok) {
return await response.json();
} else {
@@ -46,12 +44,12 @@ export async function getUserFilesInfo() {
msg_id: 20005,
message_body: {
action: 'user_files_info',
token: token
}
}),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
}
});
@@ -83,13 +81,13 @@ export async function fetchTariffs(tariffTerm: 'MONTHLY' | 'YEAR') {
msg_id: 30001,
message_body: {
action: 'get',
user_token: token,
tariff_term: tariffTerm
}
}),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
}
});
@@ -110,6 +108,7 @@ export async function fetchTariffs(tariffTerm: 'MONTHLY' | 'YEAR') {
}
export async function fetchTokensBundle() {
const token = await getSessionData('token');
try {
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
@@ -124,7 +123,8 @@ export async function fetchTokensBundle() {
}),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
}
});
@@ -145,6 +145,7 @@ export async function fetchTokensBundle() {
}
export async function getBuildData() {
const token = await getSessionData('token');
try {
const response = await fetch(`${API_BASE_URL}/check/api/build`, {
@@ -152,6 +153,7 @@ export async function getBuildData() {
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
}
});