From 3614dc99b24442337e735dad885947ff670905fc Mon Sep 17 00:00:00 2001 From: andig Date: Thu, 17 Mar 2022 13:49:22 +0100 Subject: [PATCH] Use request variables instead of mux --- server/auth/auth.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/auth/auth.go b/server/auth/auth.go index 36ec9cbcc..53191e212 100644 --- a/server/auth/auth.go +++ b/server/auth/auth.go @@ -58,15 +58,15 @@ func (a *Auth) register(handler http.HandlerFunc) string { } func (a *Auth) handle(w http.ResponseWriter, r *http.Request) { - vars := mux.Vars(r) + q := r.URL.Query() - if error, ok := vars["error"]; ok { + if q.Has("error") { w.WriteHeader(http.StatusBadRequest) - fmt.Fprintf(w, "error: %s: %s\n", error, vars["error_description"]) + fmt.Fprintf(w, "error: %s: %s\n", q.Get("error"), q.Get("error_description")) return } - state, err := util.DecryptState(vars["state"], a.secret) + state, err := util.DecryptState(q.Get("state"), a.secret) if err != nil { w.WriteHeader(http.StatusBadRequest) fmt.Fprintf(w, "failed to decrypt state") @@ -80,7 +80,7 @@ func (a *Auth) handle(w http.ResponseWriter, r *http.Request) { } a.mu.Lock() - handler := a.routes[vars["state"]] + handler := a.routes[q.Get("state")] a.mu.Unlock() if handler == nil {