fix(TALE-31): use oidc variables first over config

This commit is contained in:
Aarnav Tale 2024-08-23 15:12:53 -04:00
parent 5a46fd0a97
commit a2054786f8
No known key found for this signature in database

View File

@ -224,6 +224,16 @@ async function checkOidc(config?: HeadscaleConfig) {
throw new Error('OIDC environment variables are incomplete') throw new Error('OIDC environment variables are incomplete')
} }
if (issuer && client && secret) {
return {
issuer,
client,
secret,
rootKey,
disableKeyLogin,
}
}
if ((!issuer || !client || !secret) && config) { if ((!issuer || !client || !secret) && config) {
issuer = config.oidc?.issuer issuer = config.oidc?.issuer
client = config.oidc?.client_id client = config.oidc?.client_id