diff --git a/apps/login/.gitignore b/apps/login/.gitignore index 6900c067209..190545517ac 100644 --- a/apps/login/.gitignore +++ b/apps/login/.gitignore @@ -1 +1 @@ -custom-config.json \ No newline at end of file +custom-config.ts \ No newline at end of file diff --git a/apps/login/config.ts b/apps/login/config.ts index 8760bc84f12..a7181b074f5 100644 --- a/apps/login/config.ts +++ b/apps/login/config.ts @@ -1,6 +1,24 @@ -import customConfig from "./custom-config"; +import fs from "fs"; +import path from "path"; import defaultConfig, { Config } from "./default-config"; +const customConfigPath = path.resolve(process.cwd(), "custom-config.js"); + +let customConfig: Partial = {}; + +if (fs.existsSync(customConfigPath)) { + import(customConfigPath) + .then((module) => { + customConfig = module.default; + console.log("found", customConfig); + }) + .catch((error) => { + console.error("Error loading custom configuration:", error); + }); +} else { + console.info("No custom configuration file found!"); +} + const config: Config = { ...defaultConfig, ...customConfig, diff --git a/apps/login/custom-config.js b/apps/login/custom-config.js new file mode 100644 index 00000000000..e08189f07f3 --- /dev/null +++ b/apps/login/custom-config.js @@ -0,0 +1,12 @@ +const customConfig = { + session: { + lifetime_in_seconds: 7200, + }, + selfservice: { + change_password: { + enabled: false, + }, + }, +}; + +module.exports = customConfig; diff --git a/apps/login/src/lib/zitadel.ts b/apps/login/src/lib/zitadel.ts index e2849e0df20..e61e255b8a2 100644 --- a/apps/login/src/lib/zitadel.ts +++ b/apps/login/src/lib/zitadel.ts @@ -31,6 +31,8 @@ import { PROVIDER_MAPPING } from "./idp"; const SESSION_LIFETIME_S = config.session.lifetime_in_seconds; +console.log("Session lifetime", SESSION_LIFETIME_S); + const transport = createServerTransport( process.env.ZITADEL_SERVICE_USER_TOKEN!, { diff --git a/apps/login/src/ui/Boundary.tsx b/apps/login/src/ui/Boundary.tsx index c7487df1a92..ef06be3fdf3 100644 --- a/apps/login/src/ui/Boundary.tsx +++ b/apps/login/src/ui/Boundary.tsx @@ -44,7 +44,7 @@ export const Boundary = ({
{list.map((menuitem, index) => { diff --git a/apps/login/tsconfig.json b/apps/login/tsconfig.json index bf3a62f57d2..a1efe752c55 100755 --- a/apps/login/tsconfig.json +++ b/apps/login/tsconfig.json @@ -12,6 +12,12 @@ } ] }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts", + "custom-config.js" + ], "exclude": ["node_modules"] }