Fixed HTTP Status code when ajaxLogin is set

See #2773