MCPcopy
hub / github.com/cli/cli / CheckAuth

Function CheckAuth

pkg/cmdutil/auth_check.go:29–39  ·  view source on GitHub ↗
(cfg gh.Config)

Source from the content-addressed store, hash-verified

27}
28
29func CheckAuth(cfg gh.Config) bool {
30 if cfg.Authentication().HasEnvToken() {
31 return true
32 }
33
34 if len(cfg.Authentication().Hosts()) > 0 {
35 return true
36 }
37
38 return false
39}
40
41func IsAuthCheckEnabled(cmd *cobra.Command) bool {
42 switch cmd.Name() {

Callers 2

NewCmdRootFunction · 0.92
Test_CheckAuthFunction · 0.85

Calls 3

HasEnvTokenMethod · 0.65
AuthenticationMethod · 0.65
HostsMethod · 0.65

Tested by 1

Test_CheckAuthFunction · 0.68