Fix login redirect behavior

This commit is contained in:
2026-05-12 22:00:56 +07:00
parent 713bfbcbb9
commit f54ff6eb0e
6 changed files with 52 additions and 9 deletions

View File

@ -1,10 +1,7 @@
import { redirect } from 'next/navigation'
import { isAuthenticated } from '@/lib/auth'
export default async function LoginPage({ searchParams }: { searchParams: Promise<{ error?: string }> }) {
if (await isAuthenticated()) {
redirect('/settings')
}
await isAuthenticated()
const params = await searchParams