Security: narrow settings props for signin page

This commit is contained in:
shamoon
2026-07-13 09:40:10 -07:00
parent 2c3b82a826
commit b0749e95d2
2 changed files with 33 additions and 4 deletions
+9 -1
View File
@@ -6,6 +6,8 @@ import { BiShieldQuarter } from "react-icons/bi";
import { getSettings } from "utils/config/config";
const PUBLIC_SIGN_IN_SETTINGS = ["theme", "color", "title", "background", "backgroundOpacity"];
export default function SignIn({ providers, settings }) {
const router = useRouter();
const [password, setPassword] = useState("");
@@ -201,7 +203,13 @@ export default function SignIn({ providers, settings }) {
export async function getServerSideProps(context) {
const providers = await getProviders();
const settings = getSettings();
const homepageSettings = getSettings();
const settings = Object.fromEntries(
PUBLIC_SIGN_IN_SETTINGS.filter((key) => Object.prototype.hasOwnProperty.call(homepageSettings, key)).map((key) => [
key,
homepageSettings[key],
]),
);
return {
props: { providers, settings },
};