diff --git a/backend/internal/config/config.go b/backend/internal/config/config.go
index d799f30..7720685 100644
--- a/backend/internal/config/config.go
+++ b/backend/internal/config/config.go
@@ -66,7 +66,12 @@ func Load() *Config {
// Load .env file if it exists.
// This is for local development convenience.
// In production, use environment variables directly.
- godotenv.Load("backend/.env")
+ // Try multiple locations: current dir, backend/.env, ../backend/.env
+ if err := godotenv.Load(".env"); err != nil {
+ if err := godotenv.Load("backend/.env"); err != nil {
+ godotenv.Load("../backend/.env")
+ }
+ }
// Return a new Config struct with all values.
// getEnv(key, default) returns the environment variable value,
diff --git a/frontend/src/app.html b/frontend/src/app.html
index 84ffad1..56f288f 100644
--- a/frontend/src/app.html
+++ b/frontend/src/app.html
@@ -1,5 +1,5 @@
-
+
diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte
index f50f2bf..2233899 100644
--- a/frontend/src/routes/+layout.svelte
+++ b/frontend/src/routes/+layout.svelte
@@ -3,30 +3,20 @@
import { goto } from '$app/navigation';
import { onMount } from 'svelte';
import { decodeJWT, isTokenValid } from '$lib/auth';
+ import '../app.css';
let { children } = $props();
let user: { userId?: number; username?: string; role?: string } | null = $state(null);
let selectedDomain = $state(null);
let loading = $state(true);
- let showDropdown = $state(false);
- let dropdownRef = $state(null);
+ let isInitialized = $state(false);
let usersLink = $derived(selectedDomain ? `/domains/${selectedDomain}/users` : '/domains');
let aliasesLink = $derived(selectedDomain ? `/domains/${selectedDomain}/aliases` : '/domains');
- let isInitialized = $state(false);
onMount(() => {
selectedDomain = localStorage.getItem('selectedDomain');
isInitialized = true;
-
- function handleClickOutside(event: MouseEvent) {
- if (dropdownRef && !dropdownRef.contains(event.target as Node)) {
- showDropdown = false;
- }
- }
-
- document.addEventListener('click', handleClickOutside);
- return () => document.removeEventListener('click', handleClickOutside);
});
$effect(() => {
@@ -74,189 +64,106 @@
localStorage.removeItem('selectedDomain');
user = null;
selectedDomain = null;
- showDropdown = false;
goto('/auth/login');
}
-
- function toggleDropdown(event: MouseEvent) {
- event.stopPropagation();
- showDropdown = !showDropdown;
- }
-{#if loading}
- Loading...
-{:else if user?.role === 'admin'}
-