MCPcopy Index your code
hub / github.com/git-bug/git-bug / getLoginFromToken

Function getLoginFromToken

bridge/github/config.go:546–563  ·  view source on GitHub ↗
(token *auth.Token)

Source from the content-addressed store, hash-verified

544}
545
546func getLoginFromToken(token *auth.Token) (string, error) {
547 ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout)
548 defer cancel()
549
550 client := buildClient(token)
551
552 var q loginQuery
553
554 err := client.queryPrintMsgs(ctx, &q, nil)
555 if err != nil {
556 return "", err
557 }
558 if q.Viewer.Login == "" {
559 return "", fmt.Errorf("github say username is empty")
560 }
561
562 return q.Viewer.Login, nil
563}

Callers 2

ConfigureMethod · 0.70
promptTokenFunction · 0.70

Calls 3

queryPrintMsgsMethod · 0.80
ErrorfMethod · 0.80
buildClientFunction · 0.70

Tested by

no test coverage detected