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

Function getViewer

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

Source from the content-addressed store, hash-verified

152}
153
154func getViewer(httpClient *http.Client, hostname, token string) (string, error) {
155 authedClient := *httpClient
156 authedClient.Transport = api.AddAuthTokenHeaderWithRefresh(httpClient.Transport, cfg{token: token})
157 return api.CurrentLoginName(api.NewClientFromHTTP(&authedClient), hostname)
158}
159
160func waitForEnter(r io.Reader) error {
161 scanner := bufio.NewScanner(r)

Callers 2

AuthFlowFunction · 0.85

Calls 3

CurrentLoginNameFunction · 0.92
NewClientFromHTTPFunction · 0.92

Tested by 1