Files
portabase/app/(auth)/layout.tsx
T

25 lines
907 B
TypeScript
Raw Normal View History

2025-11-04 08:48:46 +01:00
import React from "react";
import {redirect} from "next/navigation";
import {currentUser} from "@/lib/auth/current-user";
import {AuthLogoSection} from "@/components/wrappers/auth/auth-logo-section";
2025-02-13 19:20:55 +01:00
2025-11-04 08:48:46 +01:00
export default async function Layout({children}: { children: React.ReactNode }) {
2024-11-03 21:12:40 +01:00
2025-11-04 08:48:46 +01:00
const user = await currentUser();
2025-11-04 08:48:46 +01:00
if (user && !user.banned && user.role !== "pending") {
redirect("/dashboard/home");
2025-07-27 10:23:56 +02:00
}
return (
<div className="flex min-h-full flex-1 flex-col justify-center py-12 sm:px-6 lg:px-8 ">
<div className="mx-auto w-full max-w-md">
2025-11-04 08:48:46 +01:00
<AuthLogoSection/>
<div>{children}</div>
2024-11-03 21:12:40 +01:00
</div>
<footer className="py-4 text-center text-xs justify-items-end text-muted-foreground">
Powered by <span className="font-medium">Soluce Technologies</span>
</footer>
</div>
2024-11-03 21:12:40 +01:00
)
}