Files
plane/space/app/page.tsx

21 lines
516 B
TypeScript
Raw Normal View History

// components
import { UserLoggedIn } from "@/components/accounts";
import { AuthView } from "@/components/views";
// services
import { UserService } from "@/services/user.service";
const userServices = new UserService();
export default async function HomePage() {
const user = await userServices
.currentUser()
.then((user) => ({ ...user, isAuthenticated: true }))
.catch(() => ({ isAuthenticated: false }));
if (user.isAuthenticated) {
return <UserLoggedIn />;
}
2024-05-15 02:25:38 +05:30
return <AuthView />;
}