20e1d5a6b5
Mueve la página de login a /log-in y actualiza todas las referencias (enlace CONECTAR del header y los redirect de auth de ~45 páginas). /login ahora da 404. La API /api/auth/login no se toca (solo la ruta de página). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { getTranslations, setRequestLocale } from 'next-intl/server'
|
|
import { redirect, Link } from '@/i18n/navigation'
|
|
import { getSession } from '@/lib/session'
|
|
import { isAdmin } from '@/lib/admin'
|
|
import { listRecruitRewards } from '@/lib/admin-recruit'
|
|
import { PageShell } from '@/components/PageShell'
|
|
import { AdminRecruitManager } from '@/components/AdminRecruitManager'
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
|
|
export default async function AdminRecruitPage({ params }: { params: Promise<{ locale: string }> }) {
|
|
const { locale } = await params
|
|
setRequestLocale(locale)
|
|
const t = await getTranslations('Admin')
|
|
const session = await getSession()
|
|
if (!session.bnetId) redirect({ href: '/log-in', locale })
|
|
if (!(await isAdmin(session))) redirect({ href: '/', locale })
|
|
const rewards = await listRecruitRewards()
|
|
return (
|
|
<PageShell title={t('recruit')}>
|
|
<div className="box-content">
|
|
<div className="body-box-content">
|
|
<Link className="back-to-account" href="/admin">{t('backToPanel')}</Link>
|
|
<AdminRecruitManager initial={rewards} />
|
|
</div>
|
|
</div>
|
|
</PageShell>
|
|
)
|
|
}
|