headplane/app/routes/oidc.callback.tsx
2024-05-21 23:57:03 -04:00

14 lines
392 B
TypeScript

import { type LoaderFunctionArgs } from '@remix-run/node'
import { loadContext } from '~/utils/config/headplane'
import { finishOidc } from '~/utils/oidc'
export async function loader({ request }: LoaderFunctionArgs) {
const context = await loadContext()
if (!context.oidc) {
throw new Error('An invalid OIDC configuration was provided')
}
return finishOidc(context.oidc, request)
}