initial commit on Federted servers
release gate / check (push) Failing after 8m35s

This commit is contained in:
Andrew S Erwin
2026-10-19 16:23:55 -05:00
commit b9721ff13f
217 changed files with 31534 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
export const dynamic = 'force-dynamic'
import { NextResponse } from 'next/server'
import { signIn } from '@/auth'
export async function POST(req: Request) {
const expectedOrigin = new URL(process.env.NEXTAUTH_URL || req.url).origin
if (req.headers.get('origin') !== expectedOrigin) {
return NextResponse.json({ error: 'Invalid request origin' }, { status: 403 })
}
if (req.headers.get('content-type')?.split(';')[0].trim().toLowerCase() !== 'application/json') {
return NextResponse.json({ error: 'Content-Type must be application/json' }, { status: 415 })
}
try {
const body = await req.json()
const result = await signIn('credentials', {
email: body.email,
password: body.password,
redirect: false,
})
return NextResponse.json({ ok: true, url: result })
} catch {
return NextResponse.json({ error: 'Invalid credentials' }, { status: 401 })
}
}