cmd/tailscale: show web 'login' error message

For #1939

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
(cherry picked from commit 50c976d3f1)
This commit is contained in:
David Crawshaw 2021-05-27 10:09:35 -07:00 committed by Brad Fitzpatrick
parent 118cf0cd75
commit 039541661e

View File

@ -214,7 +214,8 @@ type mi map[string]interface{
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})