Initial commit

This commit is contained in:
Developer
2026-02-06 21:44:04 -06:00
commit f85e93c7a6
151 changed files with 22916 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { getAuth } from "@/lib/auth";
import { NextRequest, NextResponse } from "next/server";
export const runtime = "nodejs";
export async function GET(req: NextRequest) {
try {
const auth = await getAuth();
const response = await auth.handler(req);
const redirectUrl = req.nextUrl.searchParams.get("redirect") || "/account/webinars";
if (response.status >= 300 && response.status < 400) {
const location = response.headers.get("location");
if (location) {
return NextResponse.redirect(new URL(`/auth-callback?redirect=${encodeURIComponent(redirectUrl)}`, req.url));
}
}
return response;
} catch (error) {
console.error("GitHub callback error:", error);
return new Response("Authentication failed", { status: 500 });
}
}