MCPcopy Create free account
hub / github.com/dank/rlapi / authenticateWithCode

Function authenticateWithCode

examples/setup/setup.go:55–70  ·  view source on GitHub ↗
(egs *rlapi.EGS)

Source from the content-addressed store, hash-verified

53}
54
55func authenticateWithCode(egs *rlapi.EGS) *rlapi.TokenResponse {
56 authURL := egs.GetAuthURL()
57 fmt.Println(authURL)
58
59 fmt.Print("Auth code: ")
60 scanner := bufio.NewScanner(os.Stdin)
61 scanner.Scan()
62 authCode := strings.TrimSpace(scanner.Text())
63
64 auth, err := egs.AuthenticateWithCode(authCode)
65 if err != nil {
66 log.Fatalf("Failed to authenticate with code: %v", err)
67 }
68
69 return auth
70}

Callers 1

RPCFunction · 0.85

Calls 2

GetAuthURLMethod · 0.80
AuthenticateWithCodeMethod · 0.80

Tested by

no test coverage detected