Add Better Auth admin authentication
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { AuthEntry } from "@/components/auth-entry";
|
||||
import { getCurrentMockSession } from "@/lib/mock-session";
|
||||
import { isAuthenticated } from "@/lib/auth-server";
|
||||
|
||||
export default async function LoginPage() {
|
||||
const session = await getCurrentMockSession();
|
||||
const isSessionActive = await isAuthenticated();
|
||||
|
||||
if (session) {
|
||||
if (isSessionActive) {
|
||||
redirect("/dashboard");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user