fix: API_KEY is no longer required for login to work

This commit is contained in:
Aarnav Tale 2024-05-01 02:43:44 -04:00
parent a57e777a6b
commit a63f4e4d52
No known key found for this signature in database
8 changed files with 39 additions and 18 deletions

View file

@ -233,6 +233,7 @@ async function getOidcConfig() {
let issuer = process.env.OIDC_ISSUER
let client = process.env.OIDC_CLIENT_ID
let secret = process.env.OIDC_CLIENT_SECRET
const rootKey = process.env.API_KEY
if (!issuer || !client || !secret) {
const config = await getConfig()
@ -250,6 +251,10 @@ async function getOidcConfig() {
return
}
if (!rootKey) {
throw new Error('Cannot use OIDC without the root API_KEY variable set')
}
return { issuer, client, secret }
}