Skip to content

Commit

Permalink
fix login
Browse files Browse the repository at this point in the history
  • Loading branch information
dmke committed May 18, 2022
1 parent 56311cc commit 9d7ff34
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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`),
Expand Down
2 changes: 1 addition & 1 deletion exporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 9d7ff34

Please sign in to comment.