MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / handleCallback

Method handleCallback

app/cli/cmd/auth_login.go:147–166  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

145}
146
147func (a *app) handleCallback(w http.ResponseWriter, r *http.Request) {
148 token := r.URL.Query().Get("t")
149
150 defer func() {
151 a.serverChan <- nil
152 }()
153
154 if token == "" {
155 w.WriteHeader(http.StatusExpectationFailed)
156 return
157 }
158
159 if err := saveAuthToken(token); err != nil {
160 w.WriteHeader(http.StatusInternalServerError)
161 return
162 }
163
164 logger.Info().Msg("login successful!")
165 fmt.Fprintln(w, "login successful, you can now close this window and go back to the terminal")
166}
167
168func openbrowser(url string) error {
169 var cmd *exec.Cmd

Callers

nothing calls this directly

Calls 5

saveAuthTokenFunction · 0.85
WriteHeaderMethod · 0.80
GetMethod · 0.65
InfoMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected