MCPcopy
hub / github.com/cli/cli / getViewer

Function getViewer

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

Source from the content-addressed store, hash-verified

124}
125
126func getViewer(httpClient *http.Client, hostname, token string) (string, error) {
127 authedClient := *httpClient
128 authedClient.Transport = api.AddAuthTokenHeader(httpClient.Transport, cfg{token: token})
129 return api.CurrentLoginName(api.NewClientFromHTTP(&authedClient), hostname)
130}
131
132func waitForEnter(r io.Reader) error {
133 scanner := bufio.NewScanner(r)

Callers 2

AuthFlowFunction · 0.85

Calls 3

AddAuthTokenHeaderFunction · 0.92
CurrentLoginNameFunction · 0.92
NewClientFromHTTPFunction · 0.92

Tested by 1