// app/[locale]/clearcookies-then-redirect/page.tsx
"use client"

import { useEffect } from "react"
import { useRouter } from "next/navigation"

export default function ClearCookiesThenRedirect({ params }: { params: { locale: string } }) {
  const router = useRouter()

  useEffect(() => {
    fetch("/api/clearcookies", { method: "POST" }).finally(() => {
      router.replace(`/${params.locale}/login?message=sessionExpired`)
    })
  }, [])

  return null  // 什么都不渲染
}
