diff --git a/auth/auth.go b/auth/auth.go index b29176b..7d9e03d 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -51,7 +51,7 @@ func simulateTyping(sel interface{}, text string) []chrome.Action { return actions } -func Login(ctx context.Context, instanceUrl, username, password string) (*AuthInfo, error) { +func Login(ctx context.Context, username, password string) (*AuthInfo, error) { opts := chrome.DefaultExecAllocatorOptions[:] if execPath != nil { opts = append(opts, execPath) @@ -68,7 +68,7 @@ func Login(ctx context.Context, instanceUrl, username, password string) (*AuthIn info := AuthInfo{} actions := []chrome.Action{ - chrome.Navigate(instanceUrl), + chrome.Navigate("https://cloud.cambiumnetworks.com/"), chrome.WaitVisible(`a[href="/cn-rtr/sso"]`), chrome.Click(`a[href="/cn-rtr/sso"]`, chrome.NodeVisible), chrome.WaitVisible(`form#login`), diff --git a/exporter/config.go b/exporter/config.go index d3ce3a0..f36b021 100644 --- a/exporter/config.go +++ b/exporter/config.go @@ -67,7 +67,7 @@ func (c *Client) login() error { ctx, cancel := context.WithTimeout(context.Background(), loginTimeout) defer cancel() - info, err := auth.Login(ctx, c.Instance, c.Username, c.Password) + info, err := auth.Login(ctx, c.Username, c.Password) if err != nil { c.log.Errorf("login failed: %v", err) diff --git a/main.go b/main.go index d5b0976..3a19815 100644 --- a/main.go +++ b/main.go @@ -57,7 +57,7 @@ func main() { ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) defer cancel() - info, err := auth.Login(ctx, client.Instance, client.Username, client.Password) + info, err := auth.Login(ctx, client.Username, client.Password) if err != nil { log.Fatalf("login failed: %v", err)