const TokenKey = 'Admin-Token';

const tokenStorage = useStorage<null | string>(TokenKey, null);

export const getToken = () => {
    const val = tokenStorage.value;
    if (!val || val === 'undefined' || val === 'null' || val === '""') {
        return null;
    }
    return val;
};

export const setToken = (access_token: string) => (tokenStorage.value = access_token);

export const removeToken = () => (tokenStorage.value = null);
