diff --git a/vicuna-tools.d/main.go b/vicuna-tools.d/main.go index e0abe3a..cbde59d 100644 --- a/vicuna-tools.d/main.go +++ b/vicuna-tools.d/main.go @@ -98,9 +98,11 @@ func listenAndServe(ctx context.Context) { } func handle(w http.ResponseWriter, r *http.Request) { + cookie, _ := ParseCookie(r) if err := _handle(w, r); err != nil { - u, _, _ := r.BasicAuth() - log.Printf("%s: %s: %v", u, r.URL.Path, err) + log.Printf("%s: %s: %v", cookie.Name, r.URL.Path, err) + } else { + log.Printf("%s: %s", cookie.Name, r.URL.Path) } } @@ -117,7 +119,8 @@ func _handle(w http.ResponseWriter, r *http.Request) error { } func handleLogin(w http.ResponseWriter, r *http.Request) error { - return errors.New("not impl") + w.Write(htmlLogin) + return nil } func handleUI(w http.ResponseWriter, r *http.Request) error { diff --git a/vicuna-tools.d/template.d/index.html b/vicuna-tools.d/template.d/index.html index 2df8eae..d00bfd1 100644 --- a/vicuna-tools.d/template.d/index.html +++ b/vicuna-tools.d/template.d/index.html @@ -1,5 +1,6 @@
+
diff --git a/vicuna-tools.d/template.d/login.html b/vicuna-tools.d/template.d/login.html index 2df8eae..d00bfd1 100644 --- a/vicuna-tools.d/template.d/login.html +++ b/vicuna-tools.d/template.d/login.html @@ -1,5 +1,6 @@
+