mirror of
https://gitlab.massbug.com/massbug/judge4c.git
synced 2026-10-15 16:15:16 +00:00
refactor(auth): update sign-in and sign-up pages to use server-side authentication
This commit is contained in:
@@ -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";
|
import { SignInCard } from "@/features/auth/components/sign-in-card";
|
||||||
|
|
||||||
const SignInPage = () => {
|
const SignInPage = async () => {
|
||||||
|
const user = await getCurrent();
|
||||||
|
|
||||||
|
if (user) redirect("/");
|
||||||
|
|
||||||
return <SignInCard />;
|
return <SignInCard />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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";
|
import { SignUpCard } from "@/features/auth/components/sign-up-card";
|
||||||
|
|
||||||
const SignUpPage = () => {
|
const SignUpPage = async () => {
|
||||||
|
const user = await getCurrent();
|
||||||
|
|
||||||
|
if (user) redirect("/");
|
||||||
|
|
||||||
return <SignUpCard />;
|
return <SignUpCard />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user