From 07f54e878e5e2aa43b5f4eb17897eeb1e7abf4ad Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Sat, 17 Aug 2024 23:33:52 +0200 Subject: [PATCH] Revert "chore: debug playwright shutdown errors (#15456)" This reverts commit f2267082d9e33172663a0e0f8cfca52c19d004ae. --- server/http_auth.go | 3 --- tests/evcc.js | 12 ++++-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/server/http_auth.go b/server/http_auth.go index 06ccdc12a..160bd2ebd 100644 --- a/server/http_auth.go +++ b/server/http_auth.go @@ -2,7 +2,6 @@ package server import ( "encoding/json" - "fmt" "net/http" "strings" "time" @@ -98,7 +97,6 @@ func loginHandler(auth auth.Auth) http.HandlerFunc { } if !auth.IsAdminPasswordValid(req.Password) { - fmt.Println("auth: invalid password", req.Password) http.Error(w, "Invalid password", http.StatusUnauthorized) return } @@ -135,7 +133,6 @@ func ensureAuthHandler(auth auth.Auth) mux.MiddlewareFunc { // check jwt token ok, err := auth.ValidateJwtToken(jwtFromRequest(r)) if !ok || err != nil { - fmt.Println("auth: invalid auth token", jwtFromRequest(r)) http.Error(w, "Unauthorized", http.StatusUnauthorized) return } diff --git a/tests/evcc.js b/tests/evcc.js index 07fb94046..d36e53063 100644 --- a/tests/evcc.js +++ b/tests/evcc.js @@ -88,14 +88,10 @@ async function _stop(instance) { } const port = workerPort(); console.log("shutting down evcc", { port }); - try { - const res = await axios.post(`${baseUrl()}/api/auth/login`, { password: "secret" }); - console.log(res.status, res.statusText); - const cookie = res.headers["set-cookie"]; - await axios.post(`${baseUrl()}/api/system/shutdown`, {}, { headers: { cookie } }); - } catch (err) { - console.error(err); - } + const res = await axios.post(`${baseUrl()}/api/auth/login`, { password: "secret" }); + console.log(res.status, res.statusText); + const cookie = res.headers["set-cookie"]; + await axios.post(`${baseUrl()}/api/system/shutdown`, {}, { headers: { cookie } }); console.log(`wait until port ${port} is closed`); await waitOn({ resources: [`tcp:localhost:${port}`], reverse: true }); console.log("evcc is down", { port });