(egs *rlapi.EGS)
| 53 | } |
| 54 | |
| 55 | func 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 | } |
no test coverage detected