Order of the AJAX login form events makes important information unavailable
Currently the loading of the AJAX login form is done together with the loading of the page. After filling out the login data and sending the form, the full page is reloaded, which again triggers the loading of the AJAX form. Depending on the login state either the same login form is shown again or the data of the successfully logged in user is shown.
The loading order raises the problem that important information about a login attempt and the login state is missing, so we can't show any message "login failed please try again", since we just know that the user is not logged in, but nothing about the attempt.
We discussed that in the team and came to the conclusion that the only reason for that AJAX approach was to get around caching problems of user related data. Instead of using an uncached variant like USER_INT or https://fluidtypo3.org/viewhelpers/vhs/2.1.4/Render/UncacheViewHelper.html
AJAX actually would only make sense, when the form would be generated on click and give immediate feedback without reloading the page. This way we would only send one request to the server on demandand maybe reload the page once. The way it is implemented now, it could be done much easier with the uncached variants already mentioned, since a request is sent to the server with each page request anyway and a login creates another triple of requests.