more demo fixes

This commit is contained in:
orangecoding
2026-05-12 13:12:26 +02:00
parent cabef973a2
commit 0ce93acaf6
4 changed files with 12 additions and 9 deletions

View File

@@ -27,8 +27,11 @@ export default async function generalSettingsPlugin(fastify) {
}
const localSettings = await getSettings();
if (localSettings.demoMode && !isAdmin(request)) {
return reply.code(403).send({ error: 'In demo mode, it is not allowed to change these settings.' });
if (!isAdmin(request)) {
const reason = localSettings.demoMode
? 'In demo mode, it is not allowed to change these settings.'
: 'Only admins can change these settings.';
return reply.code(403).send({ error: reason });
}
try {