AJAX login_required() implementation. Closes #6