Skip to content

Commit

Permalink
fix issue with missing token/login detection
Browse files Browse the repository at this point in the history
  • Loading branch information
nitram509 committed May 12, 2024
1 parent a951306 commit a979388
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 4 additions & 1 deletion login.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ func doLogin(args *GlobalOptions, host string, encryptedPwd string) error {
}

func checkIsLoginRequired(httpResponseBody string) bool {
return len(httpResponseBody) < 10 || strings.Contains(httpResponseBody, "/login.cgi") || strings.Contains(httpResponseBody, "/redirect.html")
return len(httpResponseBody) < 10 ||
strings.Contains(httpResponseBody, "/login.cgi") ||
strings.Contains(httpResponseBody, "/wmi/login") ||
strings.Contains(httpResponseBody, "/redirect.html")
}

func getSessionToken(resp *http.Response) string {
Expand Down
10 changes: 0 additions & 10 deletions poe_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ func (poe *PoeStatusCommand) Run(args *GlobalOptions) error {
}
var statuses []PoePortStatus
statuses, err = findPortStatusInHtml(args.model, strings.NewReader(statusPage))

// FIXME: remove
if len(statuses) == 0 {
println("DEBUG: status are zero")
println("--------")
println(string(statusPage))
println("--------")

}

if err != nil {
return err
}
Expand Down

0 comments on commit a979388

Please sign in to comment.