-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ws: use the failing "init" message as /login result
If we fail a login attempt in response to receiving a { "command": "init", "problem", "..." } control message from the session program, then return the message in full as the result text for the /login page. This makes use of an until-now dead code path in cockpithandlers that pretty-prints and sets JSON data as the body of the GET /cockpit/login result if it's returned from cockpit_auth_login_finish(). Previously we were returning a fancy fail.html-formatted page which the XHR request in login.js was simply ignoring. Going forward, this will allow us to forward more interesting errors to the login page. Adjust the auth unit tests to expect the response blob in the cases where it's relevant instead of always expecting NULL on the error path. We also have to adjust two integration tests that manually inspected that the result of /login contained HTML: it no longer does, because it's JSON. Just inspect the request status reason, like login.js does. Finally, there is a couple of cases where our "more intelligent" message handling results in a more accurate error being reported: fix those in the tests.
- Loading branch information
1 parent
130e10f
commit e617508
Showing
4 changed files
with
72 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters