cmd/tailscale: show web 'login' error message

For #1939

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
pull/1992/head^2
David Crawshaw 4 years ago committed by David Crawshaw
parent d2c4e75099
commit 50c976d3f1

@ -214,7 +214,8 @@ func webHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
url, err := tailscaleUpForceReauth(r.Context())
if err != nil {
json.NewEncoder(w).Encode(mi{"error": err})
w.WriteHeader(500)
json.NewEncoder(w).Encode(mi{"error": err.Error()})
return
}
json.NewEncoder(w).Encode(mi{"url": url})

Loading…
Cancel
Save