const AUTH_KEY = "notes-auth";

export function getAuthHeader(): string | null {
  return localStorage.getItem(AUTH_KEY);
}

export function setAuthHeader(username: string, password: string): void {
  const token = btoa(`${username}:${password}`);
  localStorage.setItem(AUTH_KEY, `Basic ${token}`);
}

export function clearAuthHeader(): void {
  localStorage.removeItem(AUTH_KEY);
}
