mirror of
https://github.com/hanzo-apps/dataroom.git
synced 2026-10-30 14:47:36 +00:00
hanzo-build-linux-amd64 is the only ARC runner pool installed on hanzo-k8s today (arm64 pool is paused until DigitalOcean ships arm64 droplets, per ~/work/hanzo/.github/RUNNERS.md). The arm64 job was waiting on spark-hanzoai-arm64 — not provisioned in this cluster — so every build sat in queue forever and the amd64 leg got cancelled. Set platforms: linux/amd64 on the reusable build call to skip arm64 entirely. Re-add arm64 if/when DO ships arm64 droplets and the spark runner pool comes back online.
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { jackson } from "@/lib/jackson";
|
|
// These imports fix crypto module bundling issues with Jackson in Next.js.
|
|
// Without them, the serverless function bundle tree-shakes away jose's crypto
|
|
// primitives, causing ERR_CRYPTO_INVALID_KEYLEN at runtime.
|
|
// See: https://github.com/ory/polis/blob/main/pages/api/import-hack.ts
|
|
import * as jose from "jose";
|
|
import { NextResponse } from "next/server";
|
|
import * as openidClient from "openid-client";
|
|
|
|
// Reference the imports so they aren't removed by tree-shaking
|
|
const _dependencies = [jose, openidClient];
|
|
void _dependencies;
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function POST(req: Request) {
|
|
try {
|
|
const { oauthController } = await jackson();
|
|
|
|
const formData = await req.formData();
|
|
const body = Object.fromEntries(formData.entries());
|
|
|
|
const token = await oauthController.token(body as any);
|
|
|
|
return NextResponse.json(token);
|
|
} catch (error: any) {
|
|
console.error("[SAML] Token error:", error);
|
|
return NextResponse.json(
|
|
{ error: error.message || "Internal server error" },
|
|
{ status: 500 },
|
|
);
|
|
}
|
|
}
|