diff --git a/_frontend/src/components/MainContent.jsx b/_frontend/src/components/MainContent.jsx index d7c0fd5..90d2024 100644 --- a/_frontend/src/components/MainContent.jsx +++ b/_frontend/src/components/MainContent.jsx @@ -17,7 +17,7 @@ export const MainContent = () => { login: Login, admin: AdminPanel, apiKeys: ApiKeys, - }[route.id] || (() => <>Error) + }[route.id] || (() => <>Still nothing here) return (
diff --git a/_frontend/src/main.jsx b/_frontend/src/main.jsx index df3a9f1..a4a15e9 100644 --- a/_frontend/src/main.jsx +++ b/_frontend/src/main.jsx @@ -43,6 +43,9 @@ const App = () => { if (id !== 'login' && user !== 'admin') { location.href = '/login' } + if (id === 'login' && user === 'admin') { + location.href = '/' + } }) const [toasts, setToasts] = useState([]) diff --git a/database/database.go b/database/database.go index 727c0dc..a2bd024 100644 --- a/database/database.go +++ b/database/database.go @@ -130,7 +130,7 @@ func (db *jsonDB) store() error { } enc := json.NewEncoder(f) - enc.SetIndent("", " ") + enc.SetIndent("", " ") if err := enc.Encode(&db); err != nil { return err } diff --git a/go.mod b/go.mod index 7a5acb5..931cf1c 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.18 require ( github.com/gofiber/fiber/v2 v2.34.1 github.com/joho/godotenv v1.4.0 + golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d ) require ( @@ -13,6 +14,5 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.37.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d // indirect golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect )