feat: adding login/RegisterForm and new columns in PG
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { TeamsService, userService } from "@/services";
|
||||
import { AuthService } from "@/services";
|
||||
import {
|
||||
LoginLayout,
|
||||
LoginFormWrapper,
|
||||
LoginLoading,
|
||||
} from "@/components/login";
|
||||
import { LoginLayout, AuthWrapper, LoginLoading } from "@/components/login";
|
||||
|
||||
export default async function LoginPage() {
|
||||
try {
|
||||
@@ -20,19 +16,15 @@ export default async function LoginPage() {
|
||||
const userProfile = await userService.getUserByUuid(userUuid);
|
||||
|
||||
if (userProfile) {
|
||||
// Passer le profil utilisateur pour permettre la modification
|
||||
return (
|
||||
<LoginLayout>
|
||||
<LoginFormWrapper teams={teams} initialUser={userProfile} />
|
||||
</LoginLayout>
|
||||
);
|
||||
// Rediriger vers l'accueil si déjà connecté
|
||||
redirect("/");
|
||||
}
|
||||
}
|
||||
|
||||
// Si l'utilisateur n'est pas connecté, afficher le formulaire de connexion
|
||||
// Si l'utilisateur n'est pas connecté, afficher le formulaire d'auth
|
||||
return (
|
||||
<LoginLayout>
|
||||
<LoginFormWrapper teams={teams} />
|
||||
<AuthWrapper teams={teams} />
|
||||
</LoginLayout>
|
||||
);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user