MCPcopy Create free account
hub / github.com/cli/cli / getViewer

Function getViewer

internal/authflow/flow.go:167–171  ·  view source on GitHub ↗
(httpClient *http.Client, hostname, token string)

Source from the content-addressed store, hash-verified

165}
166
167func getViewer(httpClient *http.Client, hostname, token string) (string, error) {
168 authedClient := *httpClient
169 authedClient.Transport = api.AddAuthTokenHeaderWithRefresh(httpClient.Transport, cfg{token: token})
170 return api.CurrentLoginName(api.NewClientFromHTTP(&authedClient), hostname)
171}
172
173func waitForEnter(r io.Reader) error {
174 scanner := bufio.NewScanner(r)

Callers 2

AuthFlowFunction · 0.85

Calls 3

CurrentLoginNameFunction · 0.92
NewClientFromHTTPFunction · 0.92

Tested by 1