This commit is contained in:
peintnermax
2024-09-10 11:57:09 +02:00
parent 1bd632ad7b
commit 386ed7d297
7 changed files with 56 additions and 14 deletions

View File

@@ -1 +1 @@
custom-config.json
custom-config.ts

View File

@@ -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,

View File

@@ -0,0 +1,12 @@
const customConfig = {
session: {
lifetime_in_seconds: 7200,
},
selfservice: {
change_password: {
enabled: false,
},
},
};
module.exports = customConfig;

View File

@@ -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!,
{

View File

@@ -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",

View File

@@ -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) => {

View File

@@ -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"]
}