Renombrar /login -> /log-in en toda la web (/login da 404)

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>
This commit is contained in:
2026-07-14 21:03:31 +00:00
parent 14125dbd72
commit 20e1d5a6b5
49 changed files with 67 additions and 52 deletions
@@ -43,7 +43,7 @@ export function ActivateClient({ hash }: { hash: string }) {
<>
<span className="ok-form-response">{t('success')}</span>
<p style={{ marginTop: 16 }}>
<Link href="/login">{t('goLogin')}</Link>
<Link href="/log-in">{t('goLogin')}</Link>
</p>
</>
)}
+1 -1
View File
@@ -13,7 +13,7 @@ export default async function AdminForumPage({ params }: { params: Promise<{ loc
setRequestLocale(locale)
const t = await getTranslations('Admin')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!(await isAdmin(session))) redirect({ href: '/', locale })
const groups = await listCategoriesWithForums()
return (
+1 -1
View File
@@ -13,7 +13,7 @@ export default async function AdminGoldPage({ params }: { params: Promise<{ loca
setRequestLocale(locale)
const t = await getTranslations('Admin')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!(await isAdmin(session))) redirect({ href: '/', locale })
const options = await listGoldOptions()
return (
+1 -1
View File
@@ -13,7 +13,7 @@ export default async function AdminNewsPage({ params }: { params: Promise<{ loca
setRequestLocale(locale)
const t = await getTranslations('Admin')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!(await isAdmin(session))) redirect({ href: '/', locale })
const news = await listNews()
return (
+1 -1
View File
@@ -11,7 +11,7 @@ export default async function AdminPage({ params }: { params: Promise<{ locale:
setRequestLocale(locale)
const t = await getTranslations('Admin')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!(await isAdmin(session))) redirect({ href: '/', locale })
const items: { href: string; label: string; icon: string }[] = [
+1 -1
View File
@@ -13,7 +13,7 @@ export default async function AdminPricesPage({ params }: { params: Promise<{ lo
setRequestLocale(locale)
const t = await getTranslations('Admin')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!(await isAdmin(session))) redirect({ href: '/', locale })
const prices = await getAllPrices()
return (
+1 -1
View File
@@ -13,7 +13,7 @@ export default async function AdminPromoPage({ params }: { params: Promise<{ loc
setRequestLocale(locale)
const t = await getTranslations('Admin')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!(await isAdmin(session))) redirect({ href: '/', locale })
const codes = await listPromoCodes()
return (
+1 -1
View File
@@ -13,7 +13,7 @@ export default async function AdminRecruitPage({ params }: { params: Promise<{ l
setRequestLocale(locale)
const t = await getTranslations('Admin')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!(await isAdmin(session))) redirect({ href: '/', locale })
const rewards = await listRecruitRewards()
return (
+1 -1
View File
@@ -12,7 +12,7 @@ export default async function AdminUsersPage({ params }: { params: Promise<{ loc
setRequestLocale(locale)
const t = await getTranslations('Admin')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!(await isAdmin(session))) redirect({ href: '/', locale })
return (
<PageShell title={t('users')}>
+1 -1
View File
@@ -13,7 +13,7 @@ export default async function AdminVotesPage({ params }: { params: Promise<{ loc
setRequestLocale(locale)
const t = await getTranslations('Admin')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!(await isAdmin(session))) redirect({ href: '/', locale })
const sites = await listVoteSites()
return (
+1 -1
View File
@@ -102,7 +102,7 @@ export default async function BanHistoryPage({ params }: { params: Promise<{ loc
const t = await getTranslations('History')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const { bans, mutes } = await getSanctions(session.accountId!, session.bnetId)
+1 -1
View File
@@ -12,7 +12,7 @@ export default async function BattlepayPage({ params }: { params: Promise<{ loca
setRequestLocale(locale)
const t = await getTranslations('Battlepay')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const orders = await getPendingOrders(session.accountId ?? 0)
+1 -1
View File
@@ -12,7 +12,7 @@ export default async function ChangeEmailPage({ params }: { params: Promise<{ lo
setRequestLocale(locale)
const t = await getTranslations('ChangeEmail')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
return (
<PageShell title={t('title')}>
@@ -33,7 +33,7 @@ export default async function ChangeFactionCharacterPage({ params }: { params: P
setRequestLocale(locale)
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const [chars, price] = await Promise.all([getGameCharacters(session.accountId!), getChangeFactionPrice()])
@@ -42,7 +42,7 @@ export function ChangePasswordForm() {
setDone(true)
setMessage({ ok: true, text: t('success') })
setTimeout(() => {
router.push('/login')
router.push('/log-in')
router.refresh()
}, 2500)
} else {
@@ -12,7 +12,7 @@ export default async function ChangePasswordPage({ params }: { params: Promise<{
setRequestLocale(locale)
const t = await getTranslations('ChangePassword')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
return (
@@ -21,7 +21,7 @@ export default async function ChangeRaceCharacterPage({ params }: { params: Prom
setRequestLocale(locale)
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const [chars, price] = await Promise.all([getGameCharacters(session.accountId!), getChangeRacePrice()])
+18 -3
View File
@@ -1,17 +1,32 @@
import type { Metadata } from 'next'
import { getTranslations, setRequestLocale } from 'next-intl/server'
import { PageShell } from '@/components/PageShell'
import { RegisterForm } from './RegisterForm'
export default async function RegisterPage({ params }: { params: Promise<{ locale: string }> }) {
export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise<Metadata> {
const { locale } = await params
const t = await getTranslations({ locale, namespace: 'Register' })
return { title: t('title') }
}
export default async function CreateAccountPage({ params }: { params: Promise<{ locale: string }> }) {
const { locale } = await params
setRequestLocale(locale)
const t = await getTranslations('Register')
return (
<PageShell title={t('title')}>
<div className="box-content">
<div className="box-content" tabIndex={-1}>
<div className="body-box-content info-box-light justified">
<p>{t('info')}</p>
<p>{t('bnetType')}</p>
<p>{t('passwordRule')}</p>
<p>{t('emailRule')}</p>
<br />
<p>{t('activation1')}</p>
<p>{t('activation2')}</p>
<p>
<i className="fas fa-exclamation-triangle"></i> {t('loginHint')}
</p>
</div>
</div>
<div className="box-content">
@@ -21,7 +21,7 @@ export default async function CustomizeCharacterPage({ params }: { params: Promi
setRequestLocale(locale)
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const [chars, price] = await Promise.all([getGameCharacters(session.accountId!), getCustomizePrice()])
+1 -1
View File
@@ -21,7 +21,7 @@ export default async function DPointsPage({ params }: { params: Promise<{ locale
const t = await getTranslations('Points')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
// SumUp no tiene webhooks: reconciliamos aquí los pagos SumUp pendientes de
@@ -23,7 +23,7 @@ export default async function GoldCharacterPage({ params }: { params: Promise<{
setRequestLocale(locale)
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const [chars, options] = await Promise.all([getGameCharacters(session.accountId!), getGoldOptions()])
@@ -21,7 +21,7 @@ export default async function LevelUpCharacterPage({ params }: { params: Promise
setRequestLocale(locale)
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const [chars, price] = await Promise.all([getGameCharacters(session.accountId!), getLevelUpPrice()])
@@ -22,7 +22,7 @@ export default async function LoginPage({ params }: { params: Promise<{ locale:
</p>
<br />
<p>
{t('newHere')} <Link href="/register">{t('createAccount')}</Link>
{t('newHere')} <Link href="/create-account">{t('createAccount')}</Link>
</p>
<br />
<p className="grey-info2">{t('publicNote')}</p>
+1 -1
View File
@@ -36,7 +36,7 @@ export default async function AccountPage({ params }: { params: Promise<{ locale
const t = await getTranslations('Account')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
// Acredita cualquier pago SumUp pendiente de esta cuenta (SumUp no tiene
@@ -32,7 +32,7 @@ export default async function PointsHistoryPage({ params }: { params: Promise<{
const t = await getTranslations('History')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const [movements, balances] = await Promise.all([
+1 -1
View File
@@ -21,7 +21,7 @@ export default async function PromoCodePage({ params }: { params: Promise<{ loca
const t = await getTranslations('Points')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const realm = await getRealmName()
@@ -33,7 +33,7 @@ export default async function QuestCharacterPage({ params }: { params: Promise<{
const t = await getTranslations('CharService')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const chars = await getGameCharacters(session.accountId!)
@@ -133,7 +133,7 @@ export default async function RecruitPage({ params }: { params: Promise<{ locale
/>
) : (
<p className="centered">
<Link href="/login">{t('loginToClaim')}</Link>
<Link href="/log-in">{t('loginToClaim')}</Link>
</p>
)}
</div>
@@ -21,7 +21,7 @@ export default async function RenameCharacterPage({ params }: { params: Promise<
setRequestLocale(locale)
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const [chars, price] = await Promise.all([getGameCharacters(session.accountId!), getRenamePrice()])
+1 -1
View File
@@ -21,7 +21,7 @@ export default async function RenameGuildPage({ params }: { params: Promise<{ lo
const t = await getTranslations('Points')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const guilds = await getGuildMasterGuilds(session.accountId!)
@@ -30,7 +30,7 @@ export function ResetForm({ token }: { token: string }) {
if (data.success) {
setDone(true)
setMessage({ ok: true, text: t('success') })
setTimeout(() => router.push('/login'), 2500)
setTimeout(() => router.push('/log-in'), 2500)
} else {
const key = (ERROR_KEYS as readonly string[]).includes(data.error ?? '') ? data.error! : 'genericError'
setMessage({ ok: false, text: t(key) })
@@ -75,7 +75,7 @@ export function ResetForm({ token }: { token: string }) {
</div>
{done && (
<p>
<Link href="/login">{t('goLogin')}</Link>
<Link href="/log-in">{t('goLogin')}</Link>
</p>
)}
</>
@@ -22,7 +22,7 @@ export default async function RestoreCharacterPage({ params }: { params: Promise
const t = await getTranslations('CharService')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const chars = await getRestorableCharacters(session.accountId!)
+1 -1
View File
@@ -23,7 +23,7 @@ export default async function RestoreItemsPage({ params }: { params: Promise<{ l
const t = await getTranslations('CharService')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const [chars, price] = await Promise.all([getGameCharacters(session.accountId!), getRestoreItemPrice()])
@@ -22,7 +22,7 @@ export default async function Security2faLoginPage({ params }: { params: Promise
const t = await getTranslations('Misc')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const enabled = session.accountId ? await is2faEnabled(session.accountId) : false
@@ -42,7 +42,7 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
const t = await getTranslations('History')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const bnetEmail = session.bnetEmail || ''
@@ -15,7 +15,7 @@ export default async function SecurityTokenPage({ params }: { params: Promise<{
setRequestLocale(locale)
const t = await getTranslations('SecurityToken')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
let tokenDate: string | null = null
@@ -14,7 +14,7 @@ export default async function SelectAccountPage({ params }: { params: Promise<{
const t = await getTranslations('SelectAccount')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
// Etiqueta visible «15#1» → «WOW1» (mismo criterio que my-account/cabecera).
const games = (await getGameAccounts(session.bnetId!)).map((g) => ({ ...g, label: wowAccountLabel(g.username) }))
+1 -1
View File
@@ -23,7 +23,7 @@ export default async function SendGiftPage({ params }: { params: Promise<{ local
const t = await getTranslations('CharService')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const [chars, catalog] = await Promise.all([getGameCharacters(session.accountId!), getGiftCatalog()])
+1 -1
View File
@@ -21,7 +21,7 @@ export default async function TradePointsPage({ params }: { params: Promise<{ lo
const t = await getTranslations('Points')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const chars = await getGameCharacters(session.accountId!)
+1 -1
View File
@@ -108,7 +108,7 @@ export default async function TransHistoryPage({ params }: { params: Promise<{ l
const t = await getTranslations('History')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const txs = await getPaymentTransactions(session.accountId!)
@@ -23,7 +23,7 @@ export default async function TransferCharacterPage({ params }: { params: Promis
const t = await getTranslations('CharService')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const [chars, price] = await Promise.all([getGameCharacters(session.accountId!), getTransferPrice()])
@@ -21,7 +21,7 @@ export default async function TransferDPointsPage({ params }: { params: Promise<
const t = await getTranslations('Points')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const balance = await getDPointsBalance(session.accountId!)
@@ -14,7 +14,7 @@ export default async function UnstuckPage({ params }: { params: Promise<{ locale
setRequestLocale(locale)
const t = await getTranslations('Services')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const chars = await getGameCharacters(session.accountId!)
+1 -1
View File
@@ -45,7 +45,7 @@ export function ConfirmClient({
<span className="ok-form-response">{t('success')}</span>
{showLogin && (
<p style={{ marginTop: 16 }}>
<Link href="/login">{t('goLogin')}</Link>
<Link href="/log-in">{t('goLogin')}</Link>
</p>
)}
</>
+1 -1
View File
@@ -12,7 +12,7 @@ export async function ReviveServiceContent({ locale }: { locale: string }) {
setRequestLocale(locale)
const t = await getTranslations('Services')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const chars = await getGameCharacters(session.accountId!)
+1 -1
View File
@@ -16,7 +16,7 @@ export async function ServicePageContent({ service, locale }: { service: string;
const t = await getTranslations('Paid')
const session = await getSession()
if (!session.bnetId) redirect({ href: '/login', locale })
if (!session.bnetId) redirect({ href: '/log-in', locale })
if (!session.username) redirect({ href: '/select-account', locale })
const [chars, price] = await Promise.all([getGameCharacters(session.accountId!), cfg!.price({})])
+2 -2
View File
@@ -49,7 +49,7 @@ export function SiteHeader({
{loggedIn ? (
<Link href="/">{t('header.home')}</Link>
) : (
<Link href="/register">{t('header.register')}</Link>
<Link href="/create-account">{t('header.register')}</Link>
)}
<div className="nav-dropdown">
@@ -124,7 +124,7 @@ export function SiteHeader({
</div>
</div>
) : (
<Link href="/login" className="last">
<Link href="/log-in" className="last">
{t('header.login')}
</Link>
)}
+1 -1
View File
@@ -183,5 +183,5 @@ export async function resetPassword(token: string, newPassword: string, confPass
return { success: false, error: 'genericError' }
}
await db(DB.default).query('UPDATE home_passwordreset SET used = 1 WHERE id = ?', [pr.id])
return { success: true, redirect: '/login' }
return { success: true, redirect: '/log-in' }
}