diff --git a/apps/login/config.ts b/apps/login/config.ts deleted file mode 100644 index e8359f48046..00000000000 --- a/apps/login/config.ts +++ /dev/null @@ -1,26 +0,0 @@ -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; - }) - .catch((error) => { - console.warn("Could not find custom configuration:", error); - }); -} else { - console.info("No custom configuration file found!"); -} - -const config: Config = { - ...defaultConfig, - ...customConfig, -}; - -export default config; diff --git a/apps/login/default-config.ts b/apps/login/default-config.ts deleted file mode 100644 index e5a1388fad8..00000000000 --- a/apps/login/default-config.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface Config { - session: { - lifetime_in_seconds: number; - }; - selfservice: { - change_password: { - enabled: boolean; - }; - }; -} - -const defaultConfig: Config = { - session: { - lifetime_in_seconds: 3600, - }, - selfservice: { - change_password: { - enabled: false, - }, - }, -}; - -export default defaultConfig; diff --git a/apps/login/readme.md b/apps/login/readme.md index 91cca2b6cc1..086c0ac0708 100644 --- a/apps/login/readme.md +++ b/apps/login/readme.md @@ -1,24 +1,3 @@ # ZITADEL Login UI This is going to be our next UI for the hosted login. It's based on Next.js 13 and its introduced `app/` directory. - -## Custom Configuration - -You can overwrite the default configuration by creating a `custom-config.ts` file in the root of the project. The `custom-config.ts` file should contain the settings you want to overwrite. - -### Example `custom-config.ts` - -```js -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 984ffb5402f..6e957d6e4ef 100644 --- a/apps/login/src/lib/zitadel.ts +++ b/apps/login/src/lib/zitadel.ts @@ -17,7 +17,6 @@ import { VerifyU2FRegistrationRequest, } from "@zitadel/proto/zitadel/user/v2/user_service_pb"; -import config from "@/../config"; import { create } from "@zitadel/client"; import { TextQueryMethod } from "@zitadel/proto/zitadel/object/v2/object_pb"; import { CreateCallbackRequest } from "@zitadel/proto/zitadel/oidc/v2/oidc_service_pb"; @@ -29,7 +28,7 @@ import { import { unstable_cache } from "next/cache"; import { PROVIDER_MAPPING } from "./idp"; -const SESSION_LIFETIME_S = config.session.lifetime_in_seconds; +const SESSION_LIFETIME_S = 3600; console.log("Session lifetime", SESSION_LIFETIME_S); diff --git a/apps/login/src/ui/SelfServiceMenu.tsx b/apps/login/src/ui/SelfServiceMenu.tsx index 2a4ecf9e131..308ee05a351 100644 --- a/apps/login/src/ui/SelfServiceMenu.tsx +++ b/apps/login/src/ui/SelfServiceMenu.tsx @@ -1,4 +1,3 @@ -// import config from "@/../config"; import Link from "next/link"; export default function SelfServiceMenu({ sessionId }: { sessionId: string }) {