aboutsummaryrefslogtreecommitdiff
path: root/communities/174bg/174bg.net/src/proxy.js
diff options
context:
space:
mode:
authorAlex Pooley (@zuedev) <zuedev@gmail.com>2026-05-24 13:31:54 +0100
committerAlex Pooley (@zuedev) <zuedev@gmail.com>2026-05-24 13:31:54 +0100
commitf8a415632bbbe08e51ac5944343cb0bbf092bf2f (patch)
tree80b8088ec59e11c3bd2917a7b5ee1b663dc81460 /communities/174bg/174bg.net/src/proxy.js
parente2066f51523ecba0f1991edd0c2b94f8f4cd1820 (diff)
downloadunnamed-group-f8a415632bbbe08e51ac5944343cb0bbf092bf2f.tar
unnamed-group-f8a415632bbbe08e51ac5944343cb0bbf092bf2f.tar.gz
unnamed-group-f8a415632bbbe08e51ac5944343cb0bbf092bf2f.tar.bz2
unnamed-group-f8a415632bbbe08e51ac5944343cb0bbf092bf2f.tar.xz
unnamed-group-f8a415632bbbe08e51ac5944343cb0bbf092bf2f.zip
remove all except handbook
Diffstat (limited to 'communities/174bg/174bg.net/src/proxy.js')
-rw-r--r--communities/174bg/174bg.net/src/proxy.js30
1 files changed, 0 insertions, 30 deletions
diff --git a/communities/174bg/174bg.net/src/proxy.js b/communities/174bg/174bg.net/src/proxy.js
deleted file mode 100644
index dc0fa42..0000000
--- a/communities/174bg/174bg.net/src/proxy.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import { NextResponse } from "next/server";
-
-export async function proxy(request) {
- let session = null;
-
- try {
- const internalUrl =
- process.env.BETTER_AUTH_URL_INTERNAL || "http://localhost:3000";
- const res = await fetch(new URL("/api/auth/get-session", internalUrl), {
- headers: {
- cookie: request.headers.get("cookie") ?? "",
- },
- });
- session = await res.json();
- } catch {
- // If session check fails, treat as unauthenticated
- }
-
- if (!session?.user) {
- const loginUrl = new URL("/login", request.url);
- loginUrl.searchParams.set("callbackUrl", request.nextUrl.pathname);
- return NextResponse.redirect(loginUrl);
- }
-
- return NextResponse.next();
-}
-
-export const config = {
- matcher: ["/secure/:path*"],
-};