mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 05:44:36 +00:00
config
This commit is contained in:
2
apps/login/.gitignore
vendored
2
apps/login/.gitignore
vendored
@@ -1 +1 @@
|
||||
custom-config.json
|
||||
custom-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<Config> = {};
|
||||
|
||||
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,
|
||||
|
||||
12
apps/login/custom-config.js
Normal file
12
apps/login/custom-config.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const customConfig = {
|
||||
session: {
|
||||
lifetime_in_seconds: 7200,
|
||||
},
|
||||
selfservice: {
|
||||
change_password: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = customConfig;
|
||||
@@ -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!,
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ export const Boundary = ({
|
||||
<div
|
||||
className={clsx("relative rounded-lg border border-dashed", {
|
||||
"p-3 lg:p-5": size === "small",
|
||||
"p-4 lg:p-9": size === "default",
|
||||
"p-4 lg:p-9 lg:pb-6": size === "default",
|
||||
"border-divider-light dark:border-divider-dark": color === "default",
|
||||
"border-pink-500": color === "pink",
|
||||
"border-blue-500": color === "blue",
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
// import config from "@/../config";
|
||||
import Link from "next/link";
|
||||
|
||||
export default function SelfServiceMenu({ sessionId }: { sessionId: string }) {
|
||||
const list = [
|
||||
{
|
||||
link:
|
||||
`/me/change-password?` +
|
||||
new URLSearchParams({
|
||||
sessionId: sessionId,
|
||||
}),
|
||||
name: "Change password",
|
||||
},
|
||||
];
|
||||
const list: any[] = [];
|
||||
|
||||
// if (!!config.selfservice.change_password.enabled) {
|
||||
// list.push({
|
||||
// link:
|
||||
// `/me/change-password?` +
|
||||
// new URLSearchParams({
|
||||
// sessionId: sessionId,
|
||||
// }),
|
||||
// name: "Change password",
|
||||
// });
|
||||
// }
|
||||
|
||||
return (
|
||||
<div className="w-full flex flex-col space-y-2">
|
||||
{list.map((menuitem, index) => {
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user