import {OpenAPI} from "../../openapi";

export const setUpToken = (): void => {
    const token = localStorage.getItem('token');
    if (token) {
        OpenAPI.TOKEN = token; // Assign the token to OpenAPI client
    } else {
        console.warn("No token found in localStorage.");
    }
};

export const clearToken = (): void => {
    localStorage.removeItem('token');
    OpenAPI.TOKEN = ''; // Clear the token from the OpenAPI client
    console.log("Token cleared from OpenAPI and localStorage.");
};