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

Function getViewer

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

Source from the content-addressed store, hash-verified

135}
136
137func getViewer(httpClient *http.Client, hostname, token string) (string, error) {
138 authedClient := *httpClient
139 authedClient.Transport = api.AddAuthTokenHeader(httpClient.Transport, cfg{token: token})
140 return api.CurrentLoginName(api.NewClientFromHTTP(&authedClient), hostname)
141}
142
143func waitForEnter(r io.Reader) error {
144 scanner := bufio.NewScanner(r)

Callers 2

AuthFlowFunction · 0.85

Calls 3

AddAuthTokenHeaderFunction · 0.92
CurrentLoginNameFunction · 0.92
NewClientFromHTTPFunction · 0.92

Tested by 1