mirror of
https://github.com/tale/headplane.git
synced 2026-09-04 19:25:43 +00:00
feat: oidc based authentication
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user