headplane/app/routes/oidc.callback.tsx

16 lines
445 B
TypeScript
Raw Normal View History

2024-03-25 17:51:11 -04:00
import { type LoaderFunctionArgs } from '@remix-run/node'
import { finishOidc } from '~/utils/oidc'
export async function loader({ request }: LoaderFunctionArgs) {
const issuer = process.env.OIDC_ISSUER
const id = process.env.OIDC_CLIENT_ID
const secret = process.env.OIDC_CLIENT_SECRET
if (!issuer || !id || !secret) {
throw new Error('An invalid OIDC configuration was provided')
}
return finishOidc(issuer, id, secret, request)
}