refactor(auth): update sign-in and sign-up pages to use server-side authentication

This commit is contained in:
ngc2207 2025-02-01 10:03:49 +08:00
parent 40636d2d52
commit 32f52945de
2 changed files with 14 additions and 6 deletions

View File

@ -1,8 +1,12 @@
"use client";
import { redirect } from "next/navigation";
import { getCurrent } from "@/features/auth/actions";
import { SignInCard } from "@/features/auth/components/sign-in-card";
const SignInPage = () => {
const SignInPage = async () => {
const user = await getCurrent();
if (user) redirect("/");
return <SignInCard />;
};

View File

@ -1,8 +1,12 @@
"use client";
import { redirect } from "next/navigation";
import { getCurrent } from "@/features/auth/actions";
import { SignUpCard } from "@/features/auth/components/sign-up-card";
const SignUpPage = () => {
const SignUpPage = async () => {
const user = await getCurrent();
if (user) redirect("/");
return <SignUpCard />;
};