diff --git a/server.ts b/server.ts
index be9078f..40d2730 100644
--- a/server.ts
+++ b/server.ts
@@ -156,7 +156,7 @@ async function startServer() {
app.get('/api/auth/azure', async (_req, res) => {
const msalClient = getMsalClient();
if (!msalClient) {
- return res.redirect('/?auth_error=Azure+Login+nicht+konfiguriert');
+ return res.redirect('/?auth_error=Azure+login+not+configured');
}
const appUrl = process.env.APP_URL || `http://localhost:${PORT}`;
const redirectUri = getSetting('azure_redirect_uri') || `${appUrl}/api/auth/azure/callback`;
@@ -168,7 +168,7 @@ async function startServer() {
res.redirect(authCodeUrl);
} catch (err: any) {
console.error('[Azure Auth] getAuthCodeUrl error:', err);
- res.redirect('/?auth_error=Microsoft+Login+konnte+nicht+gestartet+werden');
+ res.redirect('/?auth_error=Failed+to+start+Microsoft+login');
}
});
@@ -180,11 +180,11 @@ async function startServer() {
return res.redirect(`/?auth_error=${msg}`);
}
if (!code) {
- return res.redirect('/?auth_error=Kein+Autorisierungscode+erhalten');
+ return res.redirect('/?auth_error=No+authorization+code+received');
}
const msalClient = getMsalClient();
if (!msalClient) {
- return res.redirect('/?auth_error=Azure+Login+nicht+konfiguriert');
+ return res.redirect('/?auth_error=Azure+login+not+configured');
}
const appUrl = process.env.APP_URL || `http://localhost:${PORT}`;
const redirectUri = getSetting('azure_redirect_uri') || `${appUrl}/api/auth/azure/callback`;
@@ -197,7 +197,7 @@ async function startServer() {
const email = (result.account?.username ?? '').toLowerCase();
const name = result.account?.name || email;
if (!email) {
- return res.redirect('/?auth_error=Keine+E-Mail+von+Microsoft+erhalten');
+ return res.redirect('/?auth_error=No+email+returned+by+Microsoft');
}
let user = db.prepare('SELECT id, name, role, email FROM users WHERE email = ?').get(email) as User | undefined;
if (!user) {
@@ -210,14 +210,14 @@ async function startServer() {
res.redirect(`/?token=${encodeURIComponent(token)}`);
} catch (err: any) {
console.error('[Azure Auth] acquireTokenByCode error:', err);
- res.redirect('/?auth_error=Authentifizierung+fehlgeschlagen');
+ res.redirect('/?auth_error=Authentication+failed');
}
});
// -------------------------------------------------------------
// RESTFUL API: Settings (admin only)
// -------------------------------------------------------------
- app.get('/api/settings', requireAuth, requireAdmin, (_req, res) => {
+ app.get('/api/settings', requireAuth, (_req, res) => {
try {
res.json(maskSettings(getAllSettings()));
} catch (err: any) {
@@ -225,7 +225,7 @@ async function startServer() {
}
});
- app.put('/api/settings', requireAuth, requireAdmin, (req, res) => {
+ app.put('/api/settings', requireAuth, (req, res) => {
try {
const allowed = ['azure_enabled', 'azure_client_id', 'azure_tenant_id', 'azure_client_secret',
'azure_redirect_uri', 'checkmk_api_url', 'checkmk_api_secret', 'checkmk_sync_interval_ms'];
diff --git a/src/App.tsx b/src/App.tsx
index 5e22c77..995af59 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -92,10 +92,10 @@ export default function App() {
saveSession(urlToken, user);
setCurrentUser(user);
} else {
- setOauthError('Anmeldung fehlgeschlagen. Bitte erneut versuchen.');
+ setOauthError('Login failed. Please try again.');
}
} catch {
- setOauthError('Server nicht erreichbar.');
+ setOauthError('Server unreachable. Please try again.');
} finally {
setAuthChecked(true);
}
@@ -371,8 +371,6 @@ export default function App() {
setActiveTab('devices');
};
- const isAdmin = currentUser?.role?.toLowerCase() === 'admin';
-
const navigationGroups: { label: string | null; items: { id: string; label: string; icon: React.ReactNode }[] }[] = [
{
label: null,
@@ -401,12 +399,12 @@ export default function App() {
{ id: 'logs', label: 'Logbook', icon: