uup
This commit is contained in:
22
app/routes/_index.tsx
Normal file
22
app/routes/_index.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node";
|
||||
import { redirect } from "@remix-run/node";
|
||||
import { getUserId } from "~/lib/auth.server";
|
||||
|
||||
export const meta: MetaFunction = () => {
|
||||
return [
|
||||
{ title: "نظام إدارة صيانة السيارات" },
|
||||
{ name: "description", content: "نظام شامل لإدارة صيانة السيارات" },
|
||||
];
|
||||
};
|
||||
|
||||
export async function loader({ request }: LoaderFunctionArgs) {
|
||||
const userId = await getUserId(request);
|
||||
|
||||
if (userId) {
|
||||
// User is authenticated, redirect to dashboard
|
||||
return redirect("/dashboard");
|
||||
} else {
|
||||
// User is not authenticated, redirect to signin
|
||||
return redirect("/signin");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user