MCPcopy Create free account
hub / github.com/zitadel/oidc / userCodeHandler

Method userCodeHandler

example/server/exampleop/device.go:90–107  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

88}
89
90func (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
109func redirectBack(w http.ResponseWriter, r *http.Request, prompt string) {
110 values := make(url.Values)

Callers

nothing calls this directly

Calls 2

renderUserCodeFunction · 0.85
renderDeviceLoginFunction · 0.85

Tested by

no test coverage detected