/** فقط مسیرهای داخلی سایت به‌عنوان مقصد بازگشت پذیرفته می‌شوند (جلوگیری از open redirect) */
export function safeNext(next: string | null | undefined): string {
  return next && next.startsWith("/") && !next.startsWith("//") && !next.startsWith("/\\") ? next : "/account";
}
