I have this code... I´m using it correctly... I´m using nextjs 14.0.4
我搜索了胎儿,在大多数情况下,它都行之有效。
use client
import { redirect } from "next/dist/server/api-utils";
export default function ProfilePage() {
const session = useSession();
const { status } = session;
console.log(session);
if (status === loading ) {
return false;
}
if (status === unauthenticated ) {
redirect("/")
}
}
这表明我这一错误:
Unhandled Runtime Error
Error: Invalid redirect arguments. Please use a single argument URL, e.g. res.redirect( /destination )
or use a status code and URL, e.g. res.redirect(307, /destination )
.