Basically, a login process works as follows:
- the user enters his informations in the login form and submits them,
- the server (ruby, php, nodejs, whatever) analyses these infos and,
- a) redirects to the logged in page,
- b) redirects to the loggin page with an error message (which can be handled via the url or session…),
If the process is to be done in ajax, the server can't redirect (plus it's not the desired behaviour).
Therefore what is to way to go? The server sends a message (like 'logged' or 'wrongpass') and the JavaScript handles the logic accordingly?
I couldn't find any info on the subjet.