/**
 * Bumps when auth-related storage or Redux auth actions change so components
 * that read localStorage (e.g. Header) re-render. LOGIN/LOGOUT were previously
 * dispatched without any reducer, so the UI could stay stale vs localStorage.
 */
export default function authRevision(state = 0, action) {
  switch (action.type) {
    case 'LOGIN':
    case 'LOGOUT':
    case 'AUTH_STORAGE_SYNC':
      return state + 1;
    default:
      return state;
  }
}
