From e71af87b90e9a0f48927edf5175385c16c596f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Catriel=20M=C3=BCller?= Date: Mon, 8 Apr 2024 21:59:43 -0300 Subject: [PATCH] Add support for AUTH_OIDC_TIMEOUT --- src/env.js | 8 ++++++++ src/utils/auth/oidc.ts | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/env.js b/src/env.js index 203a48be940..9e7aeb50e47 100644 --- a/src/env.js +++ b/src/env.js @@ -12,6 +12,12 @@ const zodParsedBoolean = () => .default('false') .transform((value) => trueStrings.includes(value)); +const numberSchema = z + .string() + .regex(/\d*/) + .transform((value) => (value === undefined ? undefined : Number(value))) + .optional() + const portSchema = z .string() .regex(/\d*/) @@ -90,6 +96,7 @@ const env = createEnv({ AUTH_OIDC_OWNER_GROUP: z.string().default('admin'), AUTH_OIDC_AUTO_LOGIN: zodParsedBoolean(), AUTH_OIDC_SCOPE_OVERWRITE: z.string().default('openid email profile groups'), + AUTH_OIDC_TIMEOUT: numberSchema.default(3500) } : {}), }, @@ -149,6 +156,7 @@ const env = createEnv({ AUTH_OIDC_OWNER_GROUP: process.env.AUTH_OIDC_OWNER_GROUP, AUTH_OIDC_AUTO_LOGIN: process.env.AUTH_OIDC_AUTO_LOGIN, AUTH_OIDC_SCOPE_OVERWRITE: process.env.AUTH_OIDC_SCOPE_OVERWRITE, + AUTH_OIDC_TIMEOUT: process.env.AUTH_OIDC_TIMEOUT, DEMO_MODE: process.env.DEMO_MODE, }, skipValidation: !!process.env.SKIP_ENV_VALIDATION, diff --git a/src/utils/auth/oidc.ts b/src/utils/auth/oidc.ts index f1d3e58a9a5..ead2268d7c5 100644 --- a/src/utils/auth/oidc.ts +++ b/src/utils/auth/oidc.ts @@ -50,6 +50,9 @@ const createProvider = (headers: OidcRedirectCallbackHeaders): OAuthConfig