jQuery.getJSON('/ajaxlogin/', {login:login, pass:pass}, function(result){
if (result.redirect) {
window.location = result.redirect
} else if (result.error) {
alert(result.error);
}
});
....
if (ok) {
return res.json({redirect: 'authorizationSuccess.html'})
} else {
return res.json({error: 'authorization fail!'})
}
....