mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 13:35:07 +00:00
cleanup config
This commit is contained in:
@@ -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<Config> = {};
|
||||
|
||||
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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
```
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// import config from "@/../config";
|
||||
import Link from "next/link";
|
||||
|
||||
export default function SelfServiceMenu({ sessionId }: { sessionId: string }) {
|
||||
|
||||
Reference in New Issue
Block a user