sarlink-portal/middleware.ts
TheHamkerCat e2e57516a0
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 3m38s
fix:wut
2025-01-11 04:18:26 +05:30

26 lines
720 B
TypeScript

import { betterFetch } from "@better-fetch/fetch";
import type { Session } from "better-auth/types";
import { type NextRequest, NextResponse } from "next/server";
export default async function authMiddleware(request: NextRequest) {
// const { data: session } = await betterFetch<Session>(
// "/api/auth/get-session",
// {
// baseURL: request.nextUrl.origin,
// headers: {
// //get the cookie from the request
// cookie: request.headers.get("cookie") || "",
// },
// },
// );
// if (!session) {
// return NextResponse.redirect(new URL("/login", request.url));
// }
return NextResponse.next();
}
export const config = {
matcher: ["/devices", "/", "/payments", "/payments/:paymentId"],
};