(w http.ResponseWriter, r *http.Request)
| 88 | } |
| 89 | |
| 90 | func (d *deviceLogin) userCodeHandler(w http.ResponseWriter, r *http.Request) { |
| 91 | err := r.ParseForm() |
| 92 | if err != nil { |
| 93 | w.WriteHeader(http.StatusBadRequest) |
| 94 | renderUserCode(w, err) |
| 95 | return |
| 96 | } |
| 97 | userCode := r.Form.Get("user_code") |
| 98 | if userCode == "" { |
| 99 | if prompt, _ := url.QueryUnescape(r.Form.Get("prompt")); prompt != "" { |
| 100 | err = errors.New(prompt) |
| 101 | } |
| 102 | renderUserCode(w, err) |
| 103 | return |
| 104 | } |
| 105 | |
| 106 | renderDeviceLogin(w, userCode, nil) |
| 107 | } |
| 108 | |
| 109 | func redirectBack(w http.ResponseWriter, r *http.Request, prompt string) { |
| 110 | values := make(url.Values) |
nothing calls this directly
no test coverage detected