Commit 24d04d97 by asranov0003

fix: apiclient config headers token

parent 55e267a4
import axios, { AxiosError } from "axios";
import { generateDeviceId } from "../utils/utils";
import { API_URL, TG_USER_ID, TOKEN } from "../constants/constants";
import { API_URL, TG_USER_ID } from "../constants/constants";
interface RpcRequest<TParams = unknown> {
jsonrpc: string;
......@@ -26,6 +26,8 @@ const apiClient = axios.create({
});
apiClient.interceptors.request.use((config) => {
const TOKEN = localStorage.getItem(`token-${TG_USER_ID}`);
config.headers["X-Auth-SessionToken"] = TOKEN;
return config;
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment