const authInfoKey = 'auth';

export const saveAuthInfo = (authInfo: any) => {
  localStorage.setItem(authInfoKey, JSON.stringify(authInfo));
};

export const getAuthInfo = () => {
  return JSON.parse(localStorage.getItem(authInfoKey) || 'null');
};

export const getToken = () => {
  return getAuthInfo()?.token || null;
};
