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-14 20:55:38 +00:00
return <AuthView />;
}