export function buildLoginRedirectTarget(location: Pick<Location, 'pathname' | 'search' | 'hash'>) {
  const next = `${location.pathname}${location.search}${location.hash}`
  return `/login?next=${encodeURIComponent(next)}`
}
