From a2054786f891d236fa3a32ffa3fb3cc523a7b48c Mon Sep 17 00:00:00 2001 From: Aarnav Tale Date: Fri, 23 Aug 2024 15:12:53 -0400 Subject: [PATCH] fix(TALE-31): use oidc variables first over config --- app/utils/config/headplane.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/utils/config/headplane.ts b/app/utils/config/headplane.ts index 8b07050..f6770f5 100644 --- a/app/utils/config/headplane.ts +++ b/app/utils/config/headplane.ts @@ -224,6 +224,16 @@ async function checkOidc(config?: HeadscaleConfig) { throw new Error('OIDC environment variables are incomplete') } + if (issuer && client && secret) { + return { + issuer, + client, + secret, + rootKey, + disableKeyLogin, + } + } + if ((!issuer || !client || !secret) && config) { issuer = config.oidc?.issuer client = config.oidc?.client_id