Evergy responds differently between a bad username/password and a bad login verification token. If it responds with a 500, then the token is bad. If it responds with a 200 (go figure) then the username and password combo is bad. If it responds with a 302 (redirecting to the account page), then the login was successful.
This PR fixes the login failure handling to use the return status codes.
I'm not sure how I was seeing a 302 with a redirect to the login page when it failed before, but I can't reproduce it now. So I took that "location" header check out of the code.
Evergy responds differently between a bad username/password and a bad login verification token. If it responds with a 500, then the token is bad. If it responds with a 200 (go figure) then the username and password combo is bad. If it responds with a 302 (redirecting to the account page), then the login was successful.
This PR fixes the login failure handling to use the return status codes.
I'm not sure how I was seeing a 302 with a redirect to the login page when it failed before, but I can't reproduce it now. So I took that "location" header check out of the code.