import type { Metadata } from 'next'; import Link from 'next/link'; import { redirect } from 'next/navigation'; import { getCurrentUser } from '@/lib/auth/session'; import { safeNext } from '@/lib/auth/pending'; import { LoginForm } from './login-form'; export const metadata: Metadata = { title: 'Sign in', robots: { index: false } }; export default async function LoginPage({ searchParams }: { searchParams: Promise> }) { const sp = await searchParams; const next = safeNext(typeof sp.next === 'string' ? sp.next : null); const user = await getCurrentUser(); if (user) redirect(next); return ( <>

Sign in

Welcome back. Your collections, watchlists and alerts are waiting.

{sp.reset ?

Password updated. Sign in with your new password.

: null} {sp.expired ?

Your session expired. Please sign in again.

: null}

New to RareIndex?{' '} Create an account

); }