export const SCOPE_INSUFFICIENT = "scope_insufficient"; /** Client-side: redirect to /auth/login to upgrade scope, preserving the current URL. */ export function redirectToScopeUpgrade(requiredScope: string): void { const returnTo = window.location.pathname + window.location.search; const params = new URLSearchParams({ scope: requiredScope, returnTo }); window.location.href = `/auth/login?${params}`; }