Fixed status code when ajaxLogin is set

See issue #2773