feat: oidc based authentication

This commit is contained in:
Aarnav Tale
2024-03-25 17:51:11 -04:00
parent 025cc4f6f1
commit 58992efa2e
10 changed files with 494 additions and 62 deletions
+15
View File
@@ -0,0 +1,15 @@
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)
}